diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-06-21 14:40:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-21 14:40:28 +0800 |
commit | 1db1476fd98a161df112863dbc87334394083341 (patch) | |
tree | 20b8b3471a62dbf4e3d59c1a77ed3fb527039256 | |
parent | a5d8e5336a0bc21c1841d45d47befb94ca2b54f4 (diff) | |
download | rneovim-1db1476fd98a161df112863dbc87334394083341.tar.gz rneovim-1db1476fd98a161df112863dbc87334394083341.tar.bz2 rneovim-1db1476fd98a161df112863dbc87334394083341.zip |
vim-patch:9.1.0512: Mode message for spell completion doesn't match allowed keys (#29437)
Problem: Mode message for spell completion doesn't match allowed keys
(Kyle Kovacs)
Solution: Show "^S" instead of "s".
(zeertzjq)
This matches the code in vim_is_ctrl_x_key():
case CTRL_X_SPELL:
return (c == Ctrl_S || c == Ctrl_P || c == Ctrl_N);
fixes: neovim/neovim#29431
closes: vim/vim#15065
https://github.com/vim/vim/commit/7002c055d560ae0b3bb1e24ad409390a5443daad
-rw-r--r-- | src/nvim/insexpand.c | 2 | ||||
-rw-r--r-- | test/old/testdir/test_spell.vim | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 353efb6442..2c9b2ca141 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -123,7 +123,7 @@ static char *ctrl_x_msgs[] = { N_(" Command-line completion (^V^N^P)"), N_(" User defined completion (^U^N^P)"), N_(" Omni completion (^O^N^P)"), - N_(" Spelling suggestion (s^N^P)"), + N_(" Spelling suggestion (^S^N^P)"), N_(" Keyword Local completion (^N^P)"), NULL, // CTRL_X_EVAL doesn't use msg. N_(" Command-line completion (^V^N^P)"), diff --git a/test/old/testdir/test_spell.vim b/test/old/testdir/test_spell.vim index a19b64a7de..d55a51e8eb 100644 --- a/test/old/testdir/test_spell.vim +++ b/test/old/testdir/test_spell.vim @@ -5,6 +5,7 @@ source check.vim CheckFeature spell source screendump.vim +source view_util.vim func TearDown() set nospell @@ -300,6 +301,20 @@ func Test_compl_with_CTRL_X_CTRL_K_using_spell() set spell& spelllang& dictionary& ignorecase& endfunc +func Test_compl_with_CTRL_X_s() + new + set spell spelllang=en_us showmode + inoremap <buffer><F2> <Cmd>let g:msg = Screenline(&lines)<CR> + + call feedkeys("STheatre\<C-X>s\<F2>\<C-Y>\<Esc>", 'tx') + call assert_equal(['Theater'], getline(1, '$')) + call assert_match('(^S^N^P)', g:msg) + + bwipe! + set spell& spelllang& showmode& + unlet g:msg +endfunc + func Test_spellrepall() new set spell |