Skip to content

Commit 64edcb1

Browse files
committed
Another frustrating API bug
1 parent 1f8c4d5 commit 64edcb1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

BufferScroll.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ def plugin_loaded():
3131
Pref.load()
3232
s.add_on_change('reload', lambda:Pref.load())
3333

34+
# TODO the application is not sendinng on_load when opening a window,
35+
# then there is this hack which will simulate on_load when you open the application
36+
# since this is just a hack, there is a terrible noticeable delay, which just sucks, thank you.
37+
for view in sublime.active_window().views():
38+
BufferScrollAPI.on_load(view)
39+
3440
# threads listening scroll, and waiting to set data on focus change
3541
if not 'running_synch_data_loop' in globals():
3642
global running_synch_data_loop
@@ -269,7 +275,7 @@ def restore(self, view, where = 'unknow'):
269275
print('current view.viewport_position()')
270276
print(view.viewport_position());
271277
print('setting view port position to');
272-
# HACK I HAD TO DELAY THE RESTORATION BECAUSE set_viewport_position does not work here.
278+
# TODO HACK I HAD TO DELAY THE RESTORATION BECAUSE set_viewport_position does not work here.
273279
if Pref.i_use_cloned_views and index in db[id]['l']:
274280
if debug:
275281
print(tuple(db[id]['l'][index]))

0 commit comments

Comments
 (0)