jisaacks / MaxPane

Sublime Text plugin to quickly maximize a pane in a multi pane layout without resetting the layout.
MIT License
78 stars 9 forks source link

Traceback on startup with ST2 #6

Closed jpcirrus closed 10 years ago

jpcirrus commented 10 years ago

On OS X with ST2. On each startup the console displays this traceback 6 times consecutively after using gamma: 2 (err: 6.9282) and before wrote startup cache, ...:

Traceback (most recent call last):
  File "./sublime_plugin.py", line 205, in on_activated
  File "./sublime_plugin.py", line 154, in run_timed_function
  File "./sublime_plugin.py", line 204, in <lambda>
  File "./max_pane.py", line 172, in on_activated
  File "./max_pane.py", line 12, in isWindowMaximized
  File "./max_pane.py", line 55, in hasLayout
AttributeError: 'NoneType' object has no attribute 'id'

That is with 2 panes open in 1 window. But it works flawlessly. Thanks!

jisaacks commented 10 years ago

It looks like in the method on_activated it is possible for the view to not have a window attached to it. A probable fix would just be to change line 172 to:

if w and PaneManager.isWindowMaximized(w):

If you want to make a pull request I would accept it.

jisaacks commented 10 years ago

fixed by #7