mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 13:38:34 +00:00
vim-patch:9.1.0132: "C" doesn't include composing chars with 'virtualedit' (#27605)
Problem: using "C" and 've=all' set, doesn't include composing chars
when changing a line, keeps the composing chars for whatever
is typed afterwards.
Solution: Use mb_head_off() and mb_ptr2len() instead of mb_tail_off().
(zeertzjq)
closes: vim/vim#14083
048761bcd4
This commit is contained in:
@@ -1770,8 +1770,13 @@ static void mb_adjust_opend(oparg_T *oap)
|
||||
return;
|
||||
}
|
||||
|
||||
char *p = ml_get(oap->end.lnum);
|
||||
oap->end.col += utf_cp_tail_off(p, p + oap->end.col);
|
||||
const char *line = ml_get(oap->end.lnum);
|
||||
const char *ptr = line + oap->end.col;
|
||||
if (*ptr != NUL) {
|
||||
ptr -= utf_head_off(line, ptr);
|
||||
ptr += utfc_ptr2len(ptr) - 1;
|
||||
oap->end.col = (colnr_T)(ptr - line);
|
||||
}
|
||||
}
|
||||
|
||||
/// Put character 'c' at position 'lp'
|
||||
|
Reference in New Issue
Block a user