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 762776 - Using too large numeric modifier on vim command freezes the editor
Using too large numeric modifier on vim command freezes the editor
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: editor
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-02-27 15:40 UTC by Richard Wiedenhöft
Modified: 2016-03-01 07:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
movements: short circuit line movements with large repeat (4.72 KB, patch)
2016-02-27 21:29 UTC, Christian Hergert
committed Details | Review

Description Richard Wiedenhöft 2016-02-27 15:40:48 UTC
When I want to yank a whole file I regularly use the following vim shortcut: "111111yy" (assuming the file is shorter than 111111 lines). This is dirty but it certainly does the job quite well in vim.

However when you do it in gnome-builder it freezes the application for quite some time. I figure that some routine is executed 111111 times. The number should be silently capped to the actual length of the file.
Comment 1 Christian Hergert 2016-02-27 21:29:14 UTC
Created attachment 322554 [details] [review]
movements: short circuit line movements with large repeat

This could still be better, but we need to break out a bunch of the weird
logic going on in here to make that possible. Most of the complexity is
due to an impedance mismatch between GtkTextBuffer and vim.
Comment 2 Christian Hergert 2016-02-27 21:30:45 UTC
This is much snappier, but still short of where it would be nice to go.

While this is enough to mark this bug fixed, I'd love someone to come in and
simplify the line movement logic for basic movements. It has a bunch of
workarounds for small movements.

Attachment 322554 [details] pushed as 003b7d6 - movements: short circuit line movements with large repeat
Comment 3 Alexandre Franke 2016-03-01 07:13:46 UTC
(In reply to Richard Wiedenhöft from comment #0)
> When I want to yank a whole file I regularly use the following vim shortcut:
> "111111yy" (assuming the file is shorter than 111111 lines). This is dirty
> but it certainly does the job quite well in vim.

Just for the record, the correct way to do this would be
ggVGy