Skip to content

Commit

Permalink
Only close the current pane if a window isn't closing
Browse files Browse the repository at this point in the history
Fixes #149
  • Loading branch information
nikoargo committed Jul 2, 2019
1 parent 5f3042d commit abd34ef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion origami.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,12 @@ def on_pre_close(self, view):
auto_close = self.settings().get("auto_close_empty_panes", auto_close)
if not auto_close:
return
window = sublime.active_window()

window = view.window()
if window == None:
# If we're the last view in the window, then the window closes before on_pre_close is called (!!).
# In this case, we don't want to close anything extra because the window is already closing.
return
active_group = window.active_group()

if self.is_tabless_view(view):
Expand Down

0 comments on commit abd34ef

Please sign in to comment.