GNOME Bugzilla – Bug 737971
Add support for paragraph movements
Last modified: 2014-10-09 22:47:07 UTC
This adds the '{' and '}' motion commands.
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.
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
Created attachment 287799 [details] [review] vim: Add support for paragraphs forward/backward motions
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.
Review of attachment 287798 [details] [review]: LGTM
Review of attachment 287799 [details] [review]: Lovely, LGTM.
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
(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 ...
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.
Created attachment 287843 [details] [review] vim: Respect count in paragraph motions Gah, missed that in commit c5fd8bce0 ...
(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 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)
Attachment 287843 [details] pushed as 1b22b67 - vim: Respect count in paragraph motions