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 737971 - Add support for paragraph movements
Add support for paragraph movements
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-06 05:31 UTC by Florian Müllner
Modified: 2014-10-09 22:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vim: Fix swapped parameters for select_range() (1.08 KB, patch)
2014-10-06 05:31 UTC, Florian Müllner
committed Details | Review
vim: Implement exclusive-motions exceptions (2.42 KB, patch)
2014-10-06 05:31 UTC, Florian Müllner
committed Details | Review
vim: Add support for paragraphs forward/backward motions (4.97 KB, patch)
2014-10-06 05:31 UTC, Florian Müllner
committed Details | Review
vim: Fix regression in select_char() (1.26 KB, patch)
2014-10-06 12:07 UTC, Florian Müllner
none Details | Review
vim: Respect count in paragraph motions (1.43 KB, patch)
2014-10-06 12:07 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2014-10-06 05:31:11 UTC
This adds the '{' and '}' motion commands.
Comment 1 Florian Müllner 2014-10-06 05:31:13 UTC
Created attachment 287797 [details] [review]
vim: Fix swapped parameters for select_range()

The order does not matter in most cases, except on empty lines; there
the selected character will be the new line, and by moving the insert
iter rather than the selection-bound iter to the next line, the current
line is changed.
Comment 2 Florian Müllner 2014-10-06 05:31:18 UTC
Created attachment 287798 [details] [review]
vim: Implement exclusive-motions exceptions

Commit 83e31754aa30b83 added basic support for exclusive motions, but
unfortunately vim's behavior is a bit more complicated than that:
Exclusive motions may become inclusive or linewise under certain
circumstances [0].

[0] http://vimdoc.sourceforge.net/htmldoc/motion.html#exclusive
Comment 3 Florian Müllner 2014-10-06 05:31:22 UTC
Created attachment 287799 [details] [review]
vim: Add support for paragraphs forward/backward motions
Comment 4 Christian Hergert 2014-10-06 05:46:43 UTC
Review of attachment 287797 [details] [review]:

LGTM

::: src/editor/gb-editor-vim.c
@@ +1203,3 @@
     gtk_text_buffer_get_end_iter (buffer, &end);
 
+  gb_editor_vim_select_range (vim, &begin, &end);

The order here is important to keep the cursor under the right position. But I think this is fine either way, since we have some special case code as you move either left or right.
Comment 5 Christian Hergert 2014-10-06 05:47:41 UTC
Review of attachment 287798 [details] [review]:

LGTM
Comment 6 Christian Hergert 2014-10-06 05:54:22 UTC
Review of attachment 287799 [details] [review]:

Lovely, LGTM.
Comment 7 Florian Müllner 2014-10-06 05:55:54 UTC
Attachment 287797 [details] pushed as 0a73223 - vim: Fix swapped parameters for select_range()
Attachment 287798 [details] pushed as 6f7ed75 - vim: Implement exclusive-motions exceptions
Attachment 287799 [details] pushed as c5fd8bc - vim: Add support for paragraphs forward/backward motions
Comment 8 Florian Müllner 2014-10-06 12:06:39 UTC
(In reply to comment #4)
> The order here is important to keep the cursor under the right position. But I
> think this is fine either way, since we have some special case code as you move
> either left or right.

Turns out that we don't - Carlos notified me that I broke 've', so reopening. I do have patches locally, but I'm on an mobile connection that's too unreliable to attach anything at the moment ...
Comment 9 Florian Müllner 2014-10-06 12:07:20 UTC
Created attachment 287842 [details] [review]
vim: Fix regression in select_char()

Commit 0a732236 fixed character selection in empty lines, but broke
the use of some motion commands as modifier (at least 'e', e.g. 'de');
so conditionalize the empty-line case and return using the old parameter
order for all other cases.
Comment 10 Florian Müllner 2014-10-06 12:07:29 UTC
Created attachment 287843 [details] [review]
vim: Respect count in paragraph motions

Gah, missed that in commit c5fd8bce0 ...
Comment 11 Florian Müllner 2014-10-06 12:08:31 UTC
(In reply to comment #8)
> I'm on an mobile connection that's too unreliable to attach anything 
> at the moment ...

Ha, should've complained earlier, looks like it helped :-)
Comment 12 Florian Müllner 2014-10-09 22:46:34 UTC
Comment on attachment 287842 [details] [review]
vim: Fix regression in select_char()

(obsoleting attachment 287842 [details] [review] - the issue it solves was already fixed in commit df96e697)
Comment 13 Florian Müllner 2014-10-09 22:47:03 UTC
Attachment 287843 [details] pushed as 1b22b67 - vim: Respect count in paragraph motions