This patch prevent delete part of multi-byte character.

Steps to reproduce bug:

1) start vim (console or GUI):

vim -u NONE -U NONE --noplugin -i NONE -n

Note:
LANG is "en_US.UTF-8"
TERM is "linux"
vim version 7.4 with patches 1-183

2) type any multi-byte character, for example, alpha:

i<C-k>a*

type newline and leave insert mode:

<cr><Esc>

3) type:

:set whichwrap=h<cr>

Results:
line 1: α
line 2: <Cursor_here>
line 3: ~
line 4: ~
...

4) type

dh

Actual results:
line 1: <ce>
line 2: ~
line 3: ~
...

Expected results:
line 1: α
line 2: ~
line 3: ~
...

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
diff -r 12ca9ea3fee5 src/normal.c
--- a/src/normal.c      Tue Feb 18 12:57:49 2014 +0700
+++ b/src/normal.c      Tue Feb 18 19:20:09 2014 +0700
@@ -6203,7 +6203,14 @@
                        && !lineempty(curwin->w_cursor.lnum))
                {
                    if (*ml_get_cursor() != NUL)
+                   {
+#ifdef FEAT_MBYTE
+                       curwin->w_cursor.col +=
+                                        (*mb_ptr2len)(ml_get_cursor());
+#else
                        ++curwin->w_cursor.col;
+#endif
+                   }
                    cap->retval |= CA_NO_ADJ_OP_END;
                }
                continue;

Reply via email to