]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.187 v7.4.187
authorBram Moolenaar <Bram@vim.org>
Sat, 22 Feb 2014 22:49:35 +0000 (23:49 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 22 Feb 2014 22:49:35 +0000 (23:49 +0100)
Problem:    Delete that crosses line break splits multi-byte character.
Solution:   Advance a character instead of a byte. (Cade Foster)

src/normal.c
src/testdir/test69.in
src/testdir/test69.ok
src/version.c

index 6bef56dcf610909c204050d5e553f393f0166496..73505a6c5df9ff7c506ef3885f694668bbe20721 100644 (file)
@@ -21,7 +21,7 @@
 static int     resel_VIsual_mode = NUL;        /* 'v', 'V', or Ctrl-V */
 static linenr_T        resel_VIsual_line_count;        /* number of lines */
 static colnr_T resel_VIsual_vcol;              /* nr of cols or end col */
-static int     VIsual_mode_orig = NUL;         /* type of Visual mode, that user entered */
+static int     VIsual_mode_orig = NUL;         /* saved Visual mode */
 
 static int     restart_VIsual_select = 0;
 #endif
@@ -6202,8 +6202,17 @@ nv_left(cap)
                            || cap->oap->op_type == OP_CHANGE)
                        && !lineempty(curwin->w_cursor.lnum))
                {
-                   if (*ml_get_cursor() != NUL)
-                       ++curwin->w_cursor.col;
+                   char_u *cp = ml_get_cursor();
+
+                   if (*cp != NUL)
+                   {
+#ifdef FEAT_MBYTE
+                       if (has_mbyte)
+                           curwin->w_cursor.col += (*mb_ptr2len)(cp);
+                       else
+#endif
+                           ++curwin->w_cursor.col;
+                   }
                    cap->retval |= CA_NO_ADJ_OP_END;
                }
                continue;
@@ -9482,7 +9491,7 @@ nv_put(cap)
 # ifdef FEAT_CLIPBOARD
            adjust_clip_reg(&regname);
 # endif
-           if (regname == 0 || regname == '"'
+          if (regname == 0 || regname == '"'
                                     || VIM_ISDIGIT(regname) || regname == '-'
 # ifdef FEAT_CLIPBOARD
                    || (clip_unnamed && (regname == '*' || regname == '+'))
index f18ee37905476eedffce698fb85cc20757041529..75317b4954b87b3d0cfb43f9abd5170a3af1f1c2 100644 (file)
@@ -154,6 +154,16 @@ ra test
 abba
 aab
 
+STARTTEST
+:set whichwrap+=h
+/^x
+dh
+:set whichwrap-=h
+ENDTEST
+
+x
+
 STARTTEST
 :let a = '.é.' " one char of two bytes
 :let b = '.é.' " normal e with composing char
index 1ff82f26bc04659436160ee6c5aad1466fb37384..41cd9d02c3252481aee2387dd2c08a5954f7a26f 100644 (file)
@@ -150,6 +150,9 @@ aaaa
 aaa
 
 
+áx
+
+
 byteidx
 [0, 1, 3, 4, -1]
 [0, 1, 4, 5, -1]
index 8dcd656cac78023755bbee4fea5687f6f3eebf21..dccd84bc89cf64f7a1cc68243bdd523356c6ef61 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    187,
 /**/
     186,
 /**/