Given a path to an existing file, if I did window.open_file(path) in the on_activated event, ST2 would crash. Every time. If I open the console and enter the same command, the file would open just fine. Then I tried to move an already open file to a different group using window.set_view_index, which also resulted in a crash. I used a method something like:
- Code: Select all
for v in window.views():
if v.file_name() == <hard coded name of file>:
the_view = v
window.set_view_index(the_view, 1, 0)
Should these sorts of operations be possible in on_activated? If not, how would one go about making sure an associated file is open in another group when a particular file is activated? If possible, I'd like it to happen automatically and not depend on a key combination. I can bind it to a key combination if necessary, I'd just like to not have to think about it.