diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-05-07 10:49:10 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-05-07 10:49:10 +0100 |
commit | ef02f16609ff0a26ffc6e20263523424980898fe (patch) | |
tree | 316bc69fdd8d9605c0d6666ea02dfd07b458e278 /src | |
parent | 70d87690a39222277c2beab0649e343a78dee908 (diff) |
patch 8.2.4899: with latin1 encoding CTRL-W might go before the cmdlinev8.2.4899
Problem: With latin1 encoding CTRL-W might go before the start of the
command line.
Solution: Check already being at the start of the command line.
Diffstat (limited to 'src')
-rw-r--r-- | src/ex_getln.c | 11 | ||||
-rw-r--r-- | src/testdir/test_cmdline.vim | 3 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 12 insertions, 4 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c index a97024b351..7020f5143a 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -1082,10 +1082,13 @@ cmdline_erase_chars( { while (p > ccline.cmdbuff && vim_isspace(p[-1])) --p; - i = vim_iswordc(p[-1]); - while (p > ccline.cmdbuff && !vim_isspace(p[-1]) - && vim_iswordc(p[-1]) == i) - --p; + if (p > ccline.cmdbuff) + { + i = vim_iswordc(p[-1]); + while (p > ccline.cmdbuff && !vim_isspace(p[-1]) + && vim_iswordc(p[-1]) == i) + --p; + } } else --p; diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 474638fb00..5a849f77f7 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -773,6 +773,9 @@ func Test_cmdline_remove_char() call feedkeys(":abc def\<S-Left>\<C-U>\<C-B>\"\<CR>", 'tx') call assert_equal('"def', @:, e) + + " This was going before the start in latin1. + call feedkeys(": \<C-W>\<CR>", 'tx') endfor let &encoding = encoding_save diff --git a/src/version.c b/src/version.c index 201d26f06e..05888c722e 100644 --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4899, +/**/ 4898, /**/ 4897, |