[gnome-builder] vim: Fix selection-bound off-by-one error in forward-word
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] vim: Fix selection-bound off-by-one error in forward-word
- Date: Sun, 5 Oct 2014 22:06:25 +0000 (UTC)
commit 61d5432405c689ae8372c7a75dffcb87f7665e50
Author: Florian Müllner <fmuellner gnome org>
Date: Sat Oct 4 19:37:32 2014 +0200
vim: Fix selection-bound off-by-one error in forward-word
'w' should move to the start (e.g. first character) of the next word.
The iter we move around indeed corresponds to this position, so the
movements without a selection turns out right - however when using
the iter as selection-bound, the selections extents up to - but not
including - the iter's position. Moving the iter one character further
fixes this, though we temporarily break its use as modifier ('dw') due
to another off-by-one error in the opposite direction.
https://bugzilla.gnome.org/show_bug.cgi?id=737959
src/editor/gb-editor-vim.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/src/editor/gb-editor-vim.c b/src/editor/gb-editor-vim.c
index 1ac2106..11af532 100644
--- a/src/editor/gb-editor-vim.c
+++ b/src/editor/gb-editor-vim.c
@@ -827,6 +827,7 @@ gb_editor_vim_move_forward_word (GbEditorVim *vim)
{
if (gtk_text_iter_equal (&iter, &selection))
gtk_text_iter_forward_word_end (&iter);
+ gtk_text_iter_forward_char (&iter);
gb_editor_vim_select_range (vim, &iter, &selection);
gb_editor_vim_ensure_anchor_selected (vim);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]