guillermooo / Vintageous

Vi/Vim emulation for Sublime Text 3
http://guillermooo.bitbucket.org/Vintageous/
Other
1.64k stars 115 forks source link

fix: :bug: where error is raised trying to scroll in a transient view #980

Closed gerardroche closed 7 years ago

gerardroche commented 9 years ago

When only one view is open and it is closed with for example ctrl-w_q then an attribute error is raised.

Traceback (most recent call last):
  File "/home/code/sublime_text_3/sublime_plugin.py", line 533, in run_
    return self.run(**args)
  File "/home/code/.config/sublime-text-3/Packages/Vintageous/xactions.py", line 914, in run
    state.eval()
  File "/home/code/.config/sublime-text-3/Packages/Vintageous/state.py", line 947, in eval
    self.reset_command_data()
  File "/home/code/.config/sublime-text-3/Packages/Vintageous/state.py", line 622, in reset_command_data
    self.scroll_into_view()
  File "/home/code/.config/sublime-text-3/Packages/Vintageous/state.py", line 610, in scroll_into_view
    view.show(view.sel()[0], False)
AttributeError: 'NoneType' object has no attribute 'show'

This fix prevents this error by not trying to scroll if the current view is transient.