[gnome-builder/wip/vim] vim: dont skip a word upon `w` when not in a word boundry.



commit 48439720d93fc11739c2f3d7c17938c6438fae49
Author: Christian Hergert <christian hergert me>
Date:   Tue Sep 30 00:56:27 2014 -0700

    vim: dont skip a word upon `w` when not in a word boundry.
    
    Just an implementation failure. Seems to work better now. This will get
    better once move_iter() lands in Gtk/GtkSourceView.

 src/editor/gb-editor-vim.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/editor/gb-editor-vim.c b/src/editor/gb-editor-vim.c
index 46d1263..293a102 100644
--- a/src/editor/gb-editor-vim.c
+++ b/src/editor/gb-editor-vim.c
@@ -364,14 +364,14 @@ gb_editor_vim_move_forward_word (GbEditorVim *vim)
    * TODO: handle there being a selection.
    */
 
-  if (!g_unichar_isspace (gtk_text_iter_get_char (&iter)) &&
-      !gtk_text_iter_ends_word (&iter))
-    if (!gtk_text_iter_forward_word_end (&iter))
-      return;
+  if (gtk_text_iter_inside_word (&iter))
+    {
+      if (!gtk_text_iter_forward_word_end (&iter))
+        gtk_text_buffer_get_end_iter (buffer, &iter);
+    }
 
-  if (!gtk_text_iter_forward_word_end (&iter) ||
-      !gtk_text_iter_backward_word_start (&iter))
-    gtk_text_buffer_get_end_iter (buffer, &iter);
+  if (gtk_text_iter_forward_word_end (&iter))
+    gtk_text_iter_backward_word_start (&iter);
 
   gtk_text_buffer_select_range (buffer, &iter, &iter);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]