GNOME Bugzilla – Bug 742855
source-vim: Improve scrolling and clean up
Last modified: 2015-01-21 20:49:22 UTC
Clean up and improve the way we scroll. Also, add line 0 and line start commands to the ones that need to make sure about the scrolling.
Created attachment 294428 [details] [review] souce-vim: Improve scrolling and clean up We need to make sure the scroll even for horizontal movements, so make sure we do that when no vertical alignment is needed. Also, as a clean up, the iter bound is always depending of the selection and if it is a selection present. So just calculate that inside ensure_scroll.
Created attachment 294429 [details] [review] source-vim: Ensure scroll for line0 and line start Those also need to make sure the scroll is correct and the cursor visible https://bugzilla.gnome.org/show_bug.cgi?id=742854
(In reply to comment #2) > Created an attachment (id=294429) [details] [review] > source-vim: Ensure scroll for line0 and line start > > Those also need to make sure the scroll is correct and the cursor > visible > > https://bugzilla.gnome.org/show_bug.cgi?id=742854 ffs, I'm being a noob with git bz file...
Created attachment 294430 [details] [review] source-vim: Ensure scroll for line0 and line start Those also need to make sure the scroll is correct and the cursor visible
This was committed a while ago, forgot to close.
(In reply to comment #5) > This was committed a while ago, forgot to close. Hi, Seems it's not
Created attachment 294963 [details] [review] [PATCH] souce-vim: Improve scrolling and clean up We need to make sure the scroll even for horizontal movements, so make sure we do that when no vertical alignment is needed. Also, as a clean up, the iter bound is always depending of the selection and if it is a selection present. So just calculate that inside ensure_scroll.
Comment on attachment 294428 [details] [review] souce-vim: Improve scrolling and clean up replaced this with forward ported patch
Okay, pushed for real this time :) Attachment 294430 [details] pushed as 400f24f - source-vim: Ensure scroll for line0 and line start Attachment 294963 [details] pushed as c706848 - [PATCH] souce-vim: Improve scrolling and clean up
awesome thanks!
I think one of the patches broke goto line through the command bar. In that case, the line should be a) centered in the middle of the screen if it was not visible on the current screen b) the cursor should be positioned to the line, if the line is visible on the current screen Same should apply to the '123G'-way of jumping to a line in normal mode, those two use different code paths (they also behave a bit differently for the case of line 0).
Created attachment 295054 [details] [review] vim: remove unnecessary call to gb_source_vim_ensure_scroll() I don't think these are necessary. Strictly speaking, they might if you use the mouse to scroll and then hit escape while in a selection, but that doesn't bother me as much as it being off for line jumps.
Comment on attachment 295054 [details] [review] vim: remove unnecessary call to gb_source_vim_ensure_scroll() This should fix jumps like ":4000<Return>" Attachment 295054 [details] pushed as e9fda2a - vim: remove unnecessary call to gb_source_vim_ensure_scroll()
Created attachment 295056 [details] [review] editor-view: focus next split if available upon vim cycle-next
Created attachment 295057 [details] [review] editor-view: focus previous split if available upon vim cycle-previous
As always, there are corner cases. But I think this is good enough now to at least consider usable. I'd like to find an alternate shortcut for closing when under Vim now that ctrl+w is swallowed. Attachment 295056 [details] pushed as d222542 - editor-view: focus next split if available upon vim cycle-next Attachment 295057 [details] pushed as ce0b6a9 - editor-view: focus previous split if available upon vim cycle-previous
(In reply to comment #11) > I think one of the patches broke goto line through the command bar. > > In that case, the line should be > > a) centered in the middle of the screen if it was not visible on the current > screen > b) the cursor should be positioned to the line, if the line is visible on the > current screen > > Same should apply to the '123G'-way of jumping to a line in normal mode, those > two use different code paths (they also behave a bit differently for the case > of line 0). I can't reproduce it here or even think what could be the problem you are seeing. With Christian patch it behaves like it behaved previously for me. Good if now is fixed! But still curious =)
Created attachment 295131 [details] screencast of vim and gnome-builder Yes it behaves like it did before. The point i want to make, is that it does not perfectly match the vim behavior. You can see that in the shown case, vim does place the cursor in line 111, but does not scroll the document. That is all I was trying to say ;)