mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Make sure msg_clear is sent after confirm message (#10065)
This commit is contained in:
parent
8a33cb32ba
commit
40218d1180
@ -505,12 +505,7 @@ static uint8_t *command_line_enter(int firstc, long count, int indent)
|
|||||||
|
|
||||||
if (ui_has(kUICmdline)) {
|
if (ui_has(kUICmdline)) {
|
||||||
ui_call_cmdline_hide(ccline.level);
|
ui_call_cmdline_hide(ccline.level);
|
||||||
if (msg_ext_is_visible()) {
|
msg_ext_clear_later();
|
||||||
msg_ext_did_cmdline = true;
|
|
||||||
if (must_redraw < VALID) {
|
|
||||||
must_redraw = VALID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cmdline_level--;
|
cmdline_level--;
|
||||||
|
@ -926,8 +926,9 @@ void ex_messages(void *const eap_p)
|
|||||||
*/
|
*/
|
||||||
void msg_end_prompt(void)
|
void msg_end_prompt(void)
|
||||||
{
|
{
|
||||||
need_wait_return = FALSE;
|
msg_ext_clear_later();
|
||||||
emsg_on_display = FALSE;
|
need_wait_return = false;
|
||||||
|
emsg_on_display = false;
|
||||||
cmdline_row = msg_row;
|
cmdline_row = msg_row;
|
||||||
msg_col = 0;
|
msg_col = 0;
|
||||||
msg_clr_eos();
|
msg_clr_eos();
|
||||||
@ -2791,12 +2792,22 @@ void msg_ext_clear(bool force)
|
|||||||
msg_ext_keep_after_cmdline = false;
|
msg_ext_keep_after_cmdline = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void msg_ext_check_prompt(void)
|
void msg_ext_clear_later(void)
|
||||||
{
|
{
|
||||||
// Redraw after cmdline is expected to clear messages.
|
if (msg_ext_is_visible()) {
|
||||||
if (msg_ext_did_cmdline) {
|
msg_ext_need_clear = true;
|
||||||
|
if (must_redraw < VALID) {
|
||||||
|
must_redraw = VALID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void msg_ext_check_clear(void)
|
||||||
|
{
|
||||||
|
// Redraw after cmdline or prompt is expected to clear messages.
|
||||||
|
if (msg_ext_need_clear) {
|
||||||
msg_ext_clear(true);
|
msg_ext_clear(true);
|
||||||
msg_ext_did_cmdline = false;
|
msg_ext_need_clear = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ extern MessageHistoryEntry *first_msg_hist;
|
|||||||
/// Last message
|
/// Last message
|
||||||
extern MessageHistoryEntry *last_msg_hist;
|
extern MessageHistoryEntry *last_msg_hist;
|
||||||
|
|
||||||
EXTERN bool msg_ext_did_cmdline INIT(= false);
|
EXTERN bool msg_ext_need_clear INIT(= false);
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
# include "message.h.generated.h"
|
# include "message.h.generated.h"
|
||||||
|
@ -369,7 +369,7 @@ void update_screen(int type)
|
|||||||
ui_comp_set_screen_valid(false);
|
ui_comp_set_screen_valid(false);
|
||||||
}
|
}
|
||||||
win_ui_flush_positions();
|
win_ui_flush_positions();
|
||||||
msg_ext_check_prompt();
|
msg_ext_check_clear();
|
||||||
|
|
||||||
/* reset cmdline_row now (may have been changed temporarily) */
|
/* reset cmdline_row now (may have been changed temporarily) */
|
||||||
compute_cmdrow();
|
compute_cmdrow();
|
||||||
|
@ -27,6 +27,30 @@ describe('ui/ext_messages', function()
|
|||||||
os.remove('Xtest')
|
os.remove('Xtest')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('msg_clear follows msg_show kind of confirm', function()
|
||||||
|
feed('iline 1<esc>')
|
||||||
|
feed(':call confirm("test")<cr>')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
line ^1 |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
]], messages={ {
|
||||||
|
content = {{"\ntest\n[O]k: ", 4}},
|
||||||
|
kind = 'confirm',
|
||||||
|
}}}
|
||||||
|
|
||||||
|
feed('<cr>')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
line ^1 |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
]]}
|
||||||
|
end)
|
||||||
|
|
||||||
it('msg_show kind=confirm,confirm_sub,emsg,wmsg,quickfix', function()
|
it('msg_show kind=confirm,confirm_sub,emsg,wmsg,quickfix', function()
|
||||||
feed('iline 1\nline 2<esc>')
|
feed('iline 1\nline 2<esc>')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user