Sublime Forum

Getting switch_file.py to open in same group

#1

Currently triggering switch_file.py will always open in the first group, not the group that is currently active. I’m attempting to decypher how to get the file to open in the current group (and if its already open in a different group, maybe to move it over).

Modifying the following at the end has the intended effect…but sometimes it still opens the file in the first group and the active group.

groupIndex = self.window.active_group();
view = self.window.open_file(new_path)
self.window.set_view_index(view, groupIndex, 0)

Any ideas how this could be improved?

Also, I would consider this a feature improvement for trunk. :smile:

0 Likes