vim-patch:7.4.187

Problem:    Delete that crosses line break splits multi-byte character.
Solution:   Advance a character instead of a byte. (Cade Foster)

https://code.google.com/p/vim/source/detail?r=a1c07956171a133583df42627d3498f935e59988
This commit is contained in:
Hinidu 2014-04-08 22:21:07 +03:00 committed by Thiago de Arruda
parent 2a0c6ff3ef
commit 321c67d610
4 changed files with 24 additions and 3 deletions

View File

@ -62,7 +62,7 @@
static int resel_VIsual_mode = NUL; /* 'v', 'V', or Ctrl-V */ static int resel_VIsual_mode = NUL; /* 'v', 'V', or Ctrl-V */
static linenr_T resel_VIsual_line_count; /* number of lines */ static linenr_T resel_VIsual_line_count; /* number of lines */
static colnr_T resel_VIsual_vcol; /* nr of cols or end col */ 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; static int restart_VIsual_select = 0;
@ -4804,8 +4804,15 @@ static void nv_left(cmdarg_T *cap)
if ( (cap->oap->op_type == OP_DELETE if ( (cap->oap->op_type == OP_DELETE
|| cap->oap->op_type == OP_CHANGE) || cap->oap->op_type == OP_CHANGE)
&& !lineempty(curwin->w_cursor.lnum)) { && !lineempty(curwin->w_cursor.lnum)) {
if (*ml_get_cursor() != NUL) char_u *cp = ml_get_cursor();
++curwin->w_cursor.col;
if (*cp != NUL) {
if (has_mbyte) {
curwin->w_cursor.col += (*mb_ptr2len)(cp);
} else {
curwin->w_cursor.col++;
}
}
cap->retval |= CA_NO_ADJ_OP_END; cap->retval |= CA_NO_ADJ_OP_END;
} }
continue; continue;

View File

@ -154,6 +154,16 @@ ra test
bb bb
b b
STARTTEST
:set whichwrap+=h
/^x
dh
:set whichwrap-=h
ENDTEST
á
x
STARTTEST STARTTEST
:let a = '.é.' " one char of two bytes :let a = '.é.' " one char of two bytes
:let b = '.é.' " normal e with composing char :let b = '.é.' " normal e with composing char

View File

@ -150,6 +150,9 @@ aaaa
aaa aaa
áx
byteidx byteidx
[0, 1, 3, 4, -1] [0, 1, 3, 4, -1]
[0, 1, 4, 5, -1] [0, 1, 4, 5, -1]

View File

@ -202,6 +202,7 @@ static char *(features[]) = {
static int included_patches[] = { static int included_patches[] = {
// Add new patch number below this line // Add new patch number below this line
187,
186, 186,
//185, //185,
184, 184,