I often need to switch back and forth between two files, and I have a very simple command to jump back to the last view.
Go back to the last view. Useful for jumping back and forth between two views
last_view = None
"""Keep track of last view
def on_deactivated(self, view):
"""When view is deactivated, record it
last_view = view
"""Go back to last view. Useful for jumping back and forth between two views
with a single key press
if last_view is not None:
It works fine, except when I bring up the console or a quick panel. I think the problem is I need to detect when I'm in the console or quick panel and not record the view. How can I do that?