From 7002c055d560ae0b3bb1e24ad409390a5443daad Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 21 Jun 2024 07:55:07 +0200 Subject: patch 9.1.0512: Mode message for spell completion doesn't match allowed keys 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: #15065 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- src/insexpand.c | 2 +- src/testdir/test_spell.vim | 15 +++++++++++++++ src/version.c | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/insexpand.c b/src/insexpand.c index 78fea51272..01fa6de83d 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -58,7 +58,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/src/testdir/test_spell.vim b/src/testdir/test_spell.vim index 1ddcd83d51..692e191a3c 100644 --- a/src/testdir/test_spell.vim +++ b/src/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 let g:msg = Screenline(&lines) + + call feedkeys("STheatre\s\\\", '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 diff --git a/src/version.c b/src/version.c index e0b0d5ccf3..41d9281a37 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 512, /**/ 511, /**/ -- cgit v1.2.3