diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-02-27 06:09:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-27 06:09:06 +0800 |
commit | 0d75324e3b7e9ab1ade4f11ee10f20840b1dd6dd (patch) | |
tree | dc3eaff204513ec67937a5d0c3111bdf3fc943ac /src/nvim/ex_getln.c | |
parent | 2ce3a9efa7ccfed359dc2bfb2e81177034977d40 (diff) | |
download | rneovim-0d75324e3b7e9ab1ade4f11ee10f20840b1dd6dd.tar.gz rneovim-0d75324e3b7e9ab1ade4f11ee10f20840b1dd6dd.tar.bz2 rneovim-0d75324e3b7e9ab1ade4f11ee10f20840b1dd6dd.zip |
vim-patch:9.1.0137: <Del> in cmdline mode doesn't delete composing chars (#27636)
Problem: <Del> in cmdline mode doesn't delete composing chars
Solution: Use mb_head_off() and mb_ptr2len() (zeertzjq)
closes: vim/vim#14095
https://github.com/vim/vim/commit/ff2b79d23956263ab0120623c37e0b4498be01db
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r-- | src/nvim/ex_getln.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index c396bbaae3..44a78711d2 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -1510,10 +1510,8 @@ static int command_line_erase_chars(CommandLineState *s) if (s->c == K_DEL && ccline.cmdpos != ccline.cmdlen) { ccline.cmdpos++; } - if (s->c == K_DEL) { - CharBoundsOff bounds = utf_cp_bounds(ccline.cmdbuff, ccline.cmdbuff + ccline.cmdpos); - ccline.cmdpos += bounds.begin_off != 0 ? bounds.end_off : 0; + ccline.cmdpos += mb_off_next(ccline.cmdbuff, ccline.cmdbuff + ccline.cmdpos); } if (ccline.cmdpos > 0) { |