Skip to content

Commit d97a2d8

Browse files
Move Git crash check earlier
This check doesn't rely on anything set earlier in `revealLater()`, so there's no reason for it to be nested within the later `if shouldReveal` condition.
1 parent 03a0870 commit d97a2d8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

SyncedSideBar.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ def show_view(view):
107107
win = view.window()
108108

109109
def revealLater():
110+
# Some versions of Sublime Text crash when revealing files under `.git/` in the side bar:
111+
# https://github.com/sublimehq/sublime_text/issues/5881
112+
if int(sublime.version()) < 4148 and '/.git/' in str(win.active_view().file_name()):
113+
return
114+
110115
if (int(sublime.version()) >= 3098):
111116
# API provided by sublime
112117
shouldReveal = win.is_sidebar_visible()
@@ -115,11 +120,6 @@ def revealLater():
115120
shouldReveal = sidebarVisible
116121

117122
if shouldReveal and reveal != False:
118-
# Some versions of Sublime Text crash when revealing files under `.git/` in the side bar:
119-
# https://github.com/sublimehq/sublime_text/issues/5881
120-
if int(sublime.version()) < 4148 and '/.git/' in str(win.active_view().file_name()):
121-
return
122-
123123
win.run_command('reveal_in_side_bar')
124124

125125
# When using quick switch project, the view activates before the sidebar is ready.

0 commit comments

Comments
 (0)