vim-patch:8.0.0714: cmdline redraw during timer #9835

vim-patch:8.0.0714: when a timer causes a command line redraw " goes missing
Problem:    When a timer causes a command line redraw the " that is displayed
            for CTRL-R goes missing.
Solution:   Remember an extra character to display.
a92522fbf3

vim-patch:8.0.0720: unfinished mapping not displayed when running timer
Problem:    Unfinished mapping not displayed when running timer.
Solution:   Also use the extra_char while waiting for a mapping and digraph.
            (closes vim/vim#1844)
6a77d2667e

close #9835
This commit is contained in:
Gabriel Cruz
2019-04-12 03:19:26 +02:00
committed by Justin M. Keyes
parent e11a9d351a
commit 3b7a4f233b
2 changed files with 14 additions and 8 deletions

View File

@@ -1447,6 +1447,9 @@ static int command_line_handle_key(CommandLineState *s)
&& ccline.cmdbuff[ccline.cmdpos - 1] != ' ');
set_cmdspos_cursor();
if (ccline.special_char != NUL) {
putcmdline(ccline.special_char, ccline.special_shift);
}
return command_line_not_changed(s);
@@ -1704,6 +1707,7 @@ static int command_line_handle_key(CommandLineState *s)
putcmdline('^', true);
s->c = get_literal(); // get next (two) character(s)
s->do_abbr = false; // don't do abbreviation now
ccline.special_char = NUL;
// may need to remove ^ when composing char was typed
if (enc_utf8 && utf_iscomposing(s->c) && !cmd_silent) {
if (ui_has(kUICmdline)) {
@@ -1721,6 +1725,7 @@ static int command_line_handle_key(CommandLineState *s)
s->ignore_drag_release = true;
putcmdline('?', true);
s->c = get_digraph(true);
ccline.special_char = NUL;
if (s->c != NUL) {
break;
@@ -3082,15 +3087,13 @@ void putcmdline(int c, int shift)
draw_cmdline(ccline.cmdpos, ccline.cmdlen - ccline.cmdpos);
}
msg_no_more = false;
} else {
ccline.special_char = c;
ccline.special_shift = shift;
if (ccline.redraw_state != kCmdRedrawAll) {
} else if (ccline.redraw_state != kCmdRedrawAll) {
ui_call_cmdline_special_char(cchar_to_string((char)(c)), shift,
ccline.level);
}
}
cursorcmd();
ccline.special_char = c;
ccline.special_shift = shift;
ui_cursor_shape();
}
@@ -3108,6 +3111,7 @@ void unputcmdline(void)
}
msg_no_more = false;
cursorcmd();
ccline.special_char = NUL;
ui_cursor_shape();
}
@@ -3468,6 +3472,10 @@ void redrawcmd(void)
set_cmdspos_cursor();
if (ccline.special_char != NUL) {
putcmdline(ccline.special_char, ccline.special_shift);
}
/*
* An emsg() before may have set msg_scroll. This is used in normal mode,
* in cmdline mode we can reset them now.

View File

@@ -975,8 +975,6 @@ describe('Expressions coloring support', function()
]])
funcs.setreg('a', {'\192'})
feed('<C-r>="<C-r><C-r>a"<C-r><C-r>a"foo"')
-- TODO(ZyX-I): Parser highlighting should not override special character
-- highlighting.
screen:expect([[
|
{EOB:~ }|
@@ -985,7 +983,7 @@ describe('Expressions coloring support', function()
{EOB:~ }|
{EOB:~ }|
{EOB:~ }|
={SQ:"}{SB:<c0>}{SQ:"}{E:<c0>"}{SB:foo}{E:"}^ |
={SQ:"}{SB:<c0>}{SQ:"}{E:<c0>"}{SB:foo}{E:"}^" |
]])
end)
end)