Sublime Forum

BufferScroll

#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

#29

Hi
I changed ā€œrestore scrollā€ to only restore the position if the current position is (0.0, 0.0)

Iā€™m not sure if that solves the other problems you are seeing, I donā€™t use build system. the problem of ā€œexternal file changesā€ has been fixed.

If you can provide a step by step guide I can try

Regards,

0 Likes

#30

Hi there. I find this plugin very useful.

Unfortunately I have a problem with it. When searching for something and clicking on the editable area youā€™re scrolled to the top.

Steps to recreate the situation:

  • open a file that doesnā€™t fit in one screen (so youā€™ll be able to scroll)
  • search for something thatā€™s not in the current viewable area
  • try clicking on the visible editable area (of the file)
    Youā€™ll be scrolled to the top.
    So, basically, the search function of the program is f**ked.

I also figured the thing causing this. It seems that the on_activated method is called when changing focus from search to the editor.
So by simply commenting out this method I solved it.

# def on_activated(self, view):
# 	if view.file_name() != None and view.file_name() != '' and not view.settings().get('is_widget'):
# 		# restore on preview tabs should be fast as posible
# 		self.restore(view)
# 		# overwrite restoration of scroll made by the application
# 		sublime.set_timeout(lambda: self.restore_scroll(view), 200)
0 Likes

#31

Hereā€™s what I did to fix this very problem: github.com/xeno-by/dotsublime/b ā€¦ rScroll.py. Iā€™m still not very happy with my changes to titoā€™s original code, but now it rarely does stupid stuff, so I decided to share.

0 Likes

#32

[quote]When searching for something and clicking on the editable area youā€™re scrolled to the top.
[/quote]

Hi sorry, I noticed the problem in minutes but forget to upload the fixed version :blush:

0 Likes

#33

Since recent updates (i canā€™t give exact date) iā€™m continuously face with this bug:

PIC

It mostly happens when i open a file that i havenā€™t used for a while.

0 Likes

#34

ahh

0 Likes

#35

Fixed. Thanks for reporting.

0 Likes

#36

Hi,

have a small issue that you plugin might be able to resolve, relating to bookmarks (which I use a lot) and cloned files (which I use a lot for double views)

Trouble is a cloned file doesnā€™t have the bookmarks in itā€¦ and then if you close the original fileā€¦ yesā€¦ youā€™ve lost all the bookmarks.

Ideally for me, cloned files would have all the bookmarks too, but possibly due to ST2 standard way of working this is not possibleā€¦ any thoughts?

cheers.

0 Likes

#37

This has been fixed.

0 Likes

#38

A problem you may found is that the same file may have different saved data depending on position.

file.txt has 1 bookmark on column 1 position 1
file.txt has 2 bookmarks on column 2 position 1
file.txt has 4 bookmarks con column 1 position 2

When you open file.txt, the package will look into the position to restore the bookmarks.

0 Likes

#39

Hey,

thanks, thats much better :smile:

Is it possibly to make it so that when I put a bookmark in a file, it also appears simultaneously in any cloned file? This would resolve bookmarks getting out of synch in cloned files (and save having to put bookmarks in twice, or close files in the correct order!)

0 Likes

#40

Hey tito!

Can i have a feature request? Ahh sorry this was too direct, can i give you a hint? :wink:

[quote=ā€œS0undā€]So my question, is there any way to set a file name specific syntax highlight color scheme?
I have a script that i use for daily work, exp.: workscript.ahk When i adding new features to the script i use a new file like: workscript_beta.ahk. But sometimes i got confused - since the code mostly identical - and sometimes iā€™m changing the ā€œwrongā€ file, aka. the normal daily work file. Is that possible to use 2 different color scheme for each file?[/quote]

[quote=ā€œjbjornsonā€]On a given view, you can set the color_scheme setting for a specific file, but it wonā€™t be remembered if you close it and open it again. Maybe you could save this as a plugin and make sure you execute it each time you open your productive fileā€¦

view.settings().set('color_scheme', 'Packages/Color Scheme - Default/Solarized (Dark).tmTheme') [/quote]

So can you save the color scheme for each opened file? + an option to turn this feature on and off, which is off by default.

0 Likes