Home Download Buy Blog Forum Support

BufferScroll

Re: BufferScroll

Postby tito on Wed Jan 25, 2012 2:18 am

Is not reloading, is saving. The message is somewhat misleading. :idea:
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 854
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: BufferScroll

Postby highend on Wed Jan 25, 2012 2:25 am

tito wrote:Is not reloading, is saving. The message is somewhat misleading. :idea:


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
highend
 
Posts: 93
Joined: Fri Jan 20, 2012 2:47 pm

Re: BufferScroll

Postby xeno.by on Mon Jan 30, 2012 6:56 pm

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
xeno.by
 
Posts: 106
Joined: Mon Jan 30, 2012 10:03 am
Location: Lausanne, Switzerland

Re: BufferScroll

Postby tito on Mon Jan 30, 2012 10:32 pm

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
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 854
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: BufferScroll

Postby xeno.by on Tue Jan 31, 2012 8:50 am

Here's what I implemented for myself: https://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.
xeno.by
 
Posts: 106
Joined: Mon Jan 30, 2012 10:03 am
Location: Lausanne, Switzerland

Re: BufferScroll

Postby tito on Tue Jan 31, 2012 1:59 pm

Will take a look thanks.
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 854
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: BufferScroll

Postby xeno.by on Wed Feb 01, 2012 9:00 am

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.
xeno.by
 
Posts: 106
Joined: Mon Jan 30, 2012 10:03 am
Location: Lausanne, Switzerland

Re: BufferScroll

Postby xeno.by on Wed Feb 01, 2012 10:25 am

Here's yet another dirty hack: https://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.
xeno.by
 
Posts: 106
Joined: Mon Jan 30, 2012 10:03 am
Location: Lausanne, Switzerland

Re: BufferScroll

Postby tito on Thu Feb 02, 2012 5:16 pm

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,
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 854
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: BufferScroll

Postby brucelee on Mon Feb 20, 2012 12:10 pm

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.

Code: Select all
# 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)
brucelee
 
Posts: 1
Joined: Mon Feb 20, 2012 11:19 am

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: Google [Bot] and 7 guests