After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743138 - vim mode: jump to lines
vim mode: jump to lines
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: editor
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-18 18:42 UTC by Florian Bäuerle
Modified: 2015-01-19 10:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vim: no need to apply scrolloff when jumping to line (934 bytes, patch)
2015-01-18 23:09 UTC, Christian Hergert
committed Details | Review
vim: add goto line through command bar (3.03 KB, patch)
2015-01-19 10:16 UTC, Florian Bäuerle
committed Details | Review

Description Florian Bäuerle 2015-01-18 18:42:59 UTC
In vim you can jump to lines by entering it's number in the command bar. I guess quite some people are using this (including me), so it should be supported in vim mode as well.
Comment 1 Florian Bäuerle 2015-01-18 21:47:15 UTC
I've been fiddling around for fixing this, but I think gb_source_vim_ensure_scroll_off() is called too overzealously. Might need some refactoring.
Comment 2 Christian Hergert 2015-01-18 22:34:19 UTC
FWIW, you can just type the line number in NORMAL mode followed by G.
Comment 3 Florian Bäuerle 2015-01-18 22:50:17 UTC
Yes, but it always applies the scroll offset. In vim, the target line will be aligned in the middle of the screen if it is not visible on the current page.
I was trying to imitate the vim behavior.
Comment 4 Christian Hergert 2015-01-18 23:09:42 UTC
Created attachment 294822 [details] [review]
vim: no need to apply scrolloff when jumping to line

We just center the line vertically to match VIM.
Comment 5 Christian Hergert 2015-01-18 23:10:07 UTC
Fixed in master, thanks!

Attachment 294822 [details] pushed as aa93d82 - vim: no need to apply scrolloff when jumping to line
Comment 6 Florian Bäuerle 2015-01-19 10:16:37 UTC
Created attachment 294850 [details] [review]
vim: add goto line through command bar

this allows going to a line with the command bar.
Comment 7 Christian Hergert 2015-01-19 10:58:06 UTC
Added followup commit to avoid creating the regex until needed.
Probably could just make it static though.

Attachment 294850 [details] pushed as 901d114 - vim: add goto line through command bar