I have this kind of code:
views_list = [(v.id(), window.get_view_index(v))
for v in window.views()]
...
for v in views_list:
for view in window.views():
if view.id() == v[0]:
vid = view
g, i = v[1][0], v[1][1]
if g:
window.set_view_index(vid, g - 1, i)
If running with windows that have an empty group (not even “untitled” buffer, just empty), Sublime Text crashes. I had crashes with Origami’s auto-close group in certain circumstances, maybe they are related. Maybe the problem is when ST tries to set a layout with a group that is completely empty (a cell is defined but there are no views in it).