Skip to content

Commit 10118ac

Browse files
committed
Cache the view window before going asynchronous, in case the view changes during the delay. Fixes #21.
1 parent 5bb0e98 commit 10118ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

SyncedSideBar.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ def show_view(view):
5858
reveal = userPref if userPref is not None else pluginPref
5959

6060
if sidebarVisible and reveal != False:
61+
win = view.window()
6162
def reveal():
62-
view.window().run_command('reveal_in_side_bar')
63+
win.run_command('reveal_in_side_bar')
6364

6465
# When using quick switch project, the view activates before the sidebar is ready.
6566
# This tiny delay is imperceptible but works around the issue.

0 commit comments

Comments
 (0)