diff options
Diffstat (limited to 'src/nvim/spellsuggest.c')
-rw-r--r-- | src/nvim/spellsuggest.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/nvim/spellsuggest.c b/src/nvim/spellsuggest.c index b37f01e769..21bfa367bf 100644 --- a/src/nvim/spellsuggest.c +++ b/src/nvim/spellsuggest.c @@ -402,7 +402,7 @@ int spell_check_sps(void) if (*s != NUL && !ascii_isdigit(*s)) { f = -1; } - // Note: Keep this in sync with p_sps_values. + // Note: Keep this in sync with opt_sps_values. } else if (strcmp(buf, "best") == 0) { f = SPS_BEST; } else if (strcmp(buf, "fast") == 0) { @@ -444,7 +444,7 @@ void spell_suggest(int count) char wcopy[MAXWLEN + 2]; suginfo_T sug; suggest_T *stp; - bool mouse_used; + bool mouse_used = false; int selected = count; int badlen = 0; int msg_scroll_save = msg_scroll; @@ -464,7 +464,7 @@ void spell_suggest(int count) // Use the Visually selected text as the bad word. But reject // a multi-line selection. if (curwin->w_cursor.lnum != VIsual.lnum) { - vim_beep(BO_SPELL); + vim_beep(kOptBoFlagSpell); return; } badlen = (int)curwin->w_cursor.col - (int)VIsual.col; @@ -516,6 +516,7 @@ void spell_suggest(int count) spell_find_suggest(line + curwin->w_cursor.col, badlen, &sug, limit, true, need_cap, true); + msg_ext_set_kind("list_cmd"); if (GA_EMPTY(&sug.su_ga)) { msg(_("Sorry, no suggestions"), 0); } else if (count > 0) { @@ -593,15 +594,11 @@ void spell_suggest(int count) cmdmsg_rl = false; msg_col = 0; // Ask for choice. - selected = prompt_for_number(&mouse_used); - - if (ui_has(kUIMessages)) { - ui_call_msg_clear(); - } - + selected = prompt_for_input(NULL, 0, false, &mouse_used); if (mouse_used) { - selected -= lines_left; + selected = sug.su_ga.ga_len + 1 - (cmdline_row - mouse_row); } + lines_left = Rows; // avoid more prompt // don't delay for 'smd' in normal_cmd() msg_scroll = msg_scroll_save; |