mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #13903 from glacambre/fix_prompt_for_number
Clear prompt_for_number messages
This commit is contained in:
commit
230f2ff381
@ -112,6 +112,7 @@
|
|||||||
#include "nvim/strings.h"
|
#include "nvim/strings.h"
|
||||||
#include "nvim/syntax.h"
|
#include "nvim/syntax.h"
|
||||||
#include "nvim/undo.h"
|
#include "nvim/undo.h"
|
||||||
|
#include "nvim/ui.h"
|
||||||
#include "nvim/os/os.h"
|
#include "nvim/os/os.h"
|
||||||
#include "nvim/os/input.h"
|
#include "nvim/os/input.h"
|
||||||
|
|
||||||
@ -2889,8 +2890,14 @@ void spell_suggest(int count)
|
|||||||
msg_col = 0;
|
msg_col = 0;
|
||||||
// Ask for choice.
|
// Ask for choice.
|
||||||
selected = prompt_for_number(&mouse_used);
|
selected = prompt_for_number(&mouse_used);
|
||||||
if (mouse_used)
|
|
||||||
|
if (ui_has(kUIMessages)) {
|
||||||
|
ui_call_msg_clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mouse_used) {
|
||||||
selected -= lines_left;
|
selected -= lines_left;
|
||||||
|
}
|
||||||
lines_left = Rows; // avoid more prompt
|
lines_left = Rows; // avoid more prompt
|
||||||
// don't delay for 'smd' in normal_cmd()
|
// don't delay for 'smd' in normal_cmd()
|
||||||
msg_scroll = msg_scroll_save;
|
msg_scroll = msg_scroll_save;
|
||||||
|
@ -29,6 +29,7 @@ describe('ui/ext_messages', function()
|
|||||||
[6] = {bold = true, reverse = true},
|
[6] = {bold = true, reverse = true},
|
||||||
[7] = {background = Screen.colors.Yellow},
|
[7] = {background = Screen.colors.Yellow},
|
||||||
[8] = {foreground = Screen.colors.Red},
|
[8] = {foreground = Screen.colors.Red},
|
||||||
|
[9] = {special = Screen.colors.Red, undercurl = true},
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
after_each(function()
|
after_each(function()
|
||||||
@ -795,6 +796,45 @@ describe('ui/ext_messages', function()
|
|||||||
pos = 9,
|
pos = 9,
|
||||||
}}}
|
}}}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('hides prompt_for_number messages', function()
|
||||||
|
command('set spell')
|
||||||
|
feed('ihelllo<esc>')
|
||||||
|
|
||||||
|
feed('z=')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{9:helllo} |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:^~ }|
|
||||||
|
]], messages={
|
||||||
|
{content = { { 'Change "helllo" to:\n 1 "Hello"\n 2 "Hallo"\n 3 "Helli"\nType number and <Enter> or click with mouse (empty cancels): ' } }, kind = ""}
|
||||||
|
}}
|
||||||
|
|
||||||
|
feed('1')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{9:helllo} |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:^~ }|
|
||||||
|
]], messages={
|
||||||
|
{content = { { 'Change "helllo" to:\n 1 "Hello"\n 2 "Hallo"\n 3 "Helli"\nType number and <Enter> or click with mouse (empty cancels): ' } }, kind = ""},
|
||||||
|
{ content = { { "1" } }, kind = "" }
|
||||||
|
}}
|
||||||
|
|
||||||
|
feed('<cr>')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
^Hello |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
]]}
|
||||||
|
|
||||||
|
end)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('ui/builtin messages', function()
|
describe('ui/builtin messages', function()
|
||||||
|
Loading…
Reference in New Issue
Block a user