Sublime Forum

BufferScroll

#9

Very nice find tito, Iā€™ve been looking for something similar. Thanks!

0 Likes

#10

I get a bit of ā€œspamā€ in the console when I use your plugin (ST 2, v2165 portable):

app ready pre session restore time: 0.277987 Traceback (most recent call last): File ".\sublime_plugin.py", line 211, in on_deactivated callback.__module__, "on_deactivated", EVENT_TIMEOUT) File ".\sublime_plugin.py", line 155, in run_timed_function ret = f() File ".\sublime_plugin.py", line 210, in <lambda> run_timed_function(lambda: callback.on_deactivated(v), File ".\BufferScroll.py", line 33, in on_deactivated File ".\BufferScroll.py", line 77, in save AttributeError: 'View' object has no attribute 'folded_regions' wrote startup cache, added files: 2 orphaned files: 3 total files: 127 cache hits: 125 startup time: 0.362697 (package setup was not run) loaded 941 snippets Traceback (most recent call last): File ".\sublime_plugin.py", line 211, in on_deactivated callback.__module__, "on_deactivated", EVENT_TIMEOUT) File ".\sublime_plugin.py", line 155, in run_timed_function ret = f() File ".\sublime_plugin.py", line 210, in <lambda> run_timed_function(lambda: callback.on_deactivated(v), File ".\BufferScroll.py", line 33, in on_deactivated File ".\BufferScroll.py", line 77, in save AttributeError: 'View' object has no attribute 'folded_regions'

I have several files open but none of them is a duplicate (e.g. via ā€œclone fileā€) of each other.

Regards,
Highend

0 Likes

#11

Update the plugin and let me know if is not working.

0 Likes

#12

Hi,

I have these lines with v2012.01.18.09.38.14, there isnā€™t any newer version available.

Regards,
Highend

0 Likes

#13

You say you have version 2165 of portable edition.

Can you please open the console and paste the output of the following:

sublime.version()

Itā€™s crazy because the line your are quoting is for greater versions.
github.com/SublimeText/BufferSc ā€¦ oll.py#L76

Thanks

0 Likes

#14

Sure:

>>> sublime.version() u'2165'

:smile:

0 Likes

#15

:smiley:

I think the package is outdated. Or Iā€™m not seeing something very obvious.

Can you check if the file
github.com/SublimeText/BufferSc ā€¦ rScroll.py
is the same to ā€œPackages/BufferScroll/BufferScroll.pyā€

Regards

0 Likes

#16

Yes, they are identical (checked with Beyond Compare).

Maybe itā€™s the ā€œuā€ in front of the ā€˜2165ā€™ version number, that confuses your version check?

Regards,
Highend

0 Likes

#17

Ok I see the error downloading your version.

sublime.version() returns a string instead of an int, and the check for version fails.

Fixed. Thank you

0 Likes

#18

Thatā€™s, IIRC this version checking was working on previous versions, tested with SideBarEnhancements.

0 Likes

#19

Confirmed, itā€™s fixed. Thank you!

Is it normal that it reloads itā€™s settings file (./Data/Packages/User/BufferScroll.sublime-settings) on each tab change / clicking on a file in the sidebar (just for the preview, not via doubleclick to load one)?

Regards,
Highend

0 Likes

#20

Yes, because the application is not sending or do not want send some ā€œeventsā€ such:

1 - Closing the application
2 - Closing a project
3 - Opening a project

Sorry for the message I have no control over that.

Regards,

0 Likes

#21

Is not reloading, is saving. The message is somewhat misleading. :bulb:

0 Likes

#22

A little bit, yeah but anyway, I have to live with that. Thanks again for fixing this little ā€œbugā€ so fast and for your kind responses!

Regards,
Highend

0 Likes

#23

The plugin doesnā€™t work correctly in the following scenarios.

Scenario 1:

  1. Open some file
  2. Mess with it, make a syntax error
  3. Scroll a few screens away
  4. Close the file, so that BufferScroll remembers the position from #3
  5. Compile the project
  6. On the build screen hit F4
  7. The file opened during #1 will be displayed and correctly positioned at the syntax error, but then BufferScroll will restore the position #3

Scenario 2:

  1. Open a file
  2. Scroll somewhere
  3. Modify the file in an external application
  4. Sublime reloads the file in the background
  5. After switching to Sublime I see a view positioned at the first line of the file
0 Likes

#24

Scenario 1:
Works as expected. If there some way to ā€œknowā€ the file is opened via ā€œbuild screenā€ Iā€™m happy to add the exception.

Scenario 2:
Will take a look, thanks for reporting.

Regards

0 Likes

#25

Hereā€™s what I implemented for myself: github.com/xeno-by/dotsublime/b ā€¦ rScroll.py. Itā€™s freaking ugly, thatā€™s why I didnā€™t make a pull request, but it works for me, and it solves both problems.

0 Likes

#26

Will take a look thanks.

0 Likes

#27

Actually, using on_activate doesnā€™t play well with overlays. When I press Ctrl+G, type the line number and press Enter, Sublime fires on_activate which cancels the effect of Ctrl+G. Okay, this thing needs more workarounds.

0 Likes

#28

Hereā€™s yet another dirty hack: github.com/xeno-by/dotsublime/c ā€¦ 6ec#diff-0.

Now I utilize the fact that overlays never show up in window.views(), despite the fact that opening an overlay fires on_activated with an overlay view as an argument (so, overlays do have underlying views). This fact can be used to filter out and ignore on_activated of a real view that happens after quitting an overlay.

0 Likes