Skip to content

Commit 2f09f8a

Browse files
committed
Move auto close empty group feature to own package
🎉 thanks to @LynnHo It's over at github.com/math2001/AutoCloseEmptyGroup
1 parent 60713d9 commit 2f09f8a

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

FileManager.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -64,30 +64,6 @@ def run(self, edit, **kwargs):
6464

6565

6666
class FmListener(sublime_plugin.EventListener):
67-
def on_pre_close(self, view):
68-
# a hack to detect tabless views, see comment below
69-
# press alt+shift+2. Do you see the empty view on the right? That's
70-
# what I call a tabless view.
71-
# It doesn't have a tab, but ST still sees it as a view
72-
if view not in view.window().views():
73-
view.settings().set("auto_close_empty_group_is_tabless_view", True)
74-
75-
def on_close(self, view):
76-
if get_settings().get("auto_close_empty_groups") is not True:
77-
return
78-
79-
# A closed even is triggered for tabless views when an actual file
80-
# is opened. Without this check, the pane that the edit_settings
81-
# command created was automatically closed
82-
if view.settings().get("auto_close_empty_group_is_tabless_view") is True:
83-
return
84-
85-
window = get_window()
86-
for group in range(window.num_groups()):
87-
if len(window.views_in_group(group)) == 0:
88-
window.run_command("close_pane")
89-
return
90-
9167
def on_load(self, view):
9268
settings = view.settings()
9369
snippet = settings.get("fm_insert_snippet_on_load", None)

0 commit comments

Comments
 (0)