comparison src/ex_getln.c @ 11674:d093e4167733 v8.0.0720

patch 8.0.0720: unfinished mapping not displayed when running timer commit https://github.com/vim/vim/commit/6a77d2667e982655f6adacee774ee7aa2581bd8a Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 16 15:24:01 2017 +0200 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 #1844)
author Christian Brabandt <cb@256bit.org>
date Sun, 16 Jul 2017 15:30:03 +0200
parents e3bfe624ba0a
children 7df3dd3c0ac1
comparison
equal deleted inserted replaced
11673:413bb3fd261e 11674:d093e4167733
52 static int new_cmdpos; /* position set by set_cmdline_pos() */ 52 static int new_cmdpos; /* position set by set_cmdline_pos() */
53 #endif 53 #endif
54 54
55 static int extra_char = NUL; /* extra character to display when redrawing 55 static int extra_char = NUL; /* extra character to display when redrawing
56 * the command line */ 56 * the command line */
57 static int extra_char_shift;
58
57 #ifdef FEAT_CMDHIST 59 #ifdef FEAT_CMDHIST
58 typedef struct hist_entry 60 typedef struct hist_entry
59 { 61 {
60 int hisnum; /* identifying number */ 62 int hisnum; /* identifying number */
61 int viminfo; /* when TRUE hisstr comes from viminfo */ 63 int viminfo; /* when TRUE hisstr comes from viminfo */
1173 case Ctrl_R: /* insert register */ 1175 case Ctrl_R: /* insert register */
1174 #ifdef USE_ON_FLY_SCROLL 1176 #ifdef USE_ON_FLY_SCROLL
1175 dont_scroll = TRUE; /* disallow scrolling here */ 1177 dont_scroll = TRUE; /* disallow scrolling here */
1176 #endif 1178 #endif
1177 putcmdline('"', TRUE); 1179 putcmdline('"', TRUE);
1178 extra_char = '"';
1179 ++no_mapping; 1180 ++no_mapping;
1180 i = c = plain_vgetc(); /* CTRL-R <char> */ 1181 i = c = plain_vgetc(); /* CTRL-R <char> */
1181 if (i == Ctrl_O) 1182 if (i == Ctrl_O)
1182 i = Ctrl_R; /* CTRL-R CTRL-O == CTRL-R CTRL-R */ 1183 i = Ctrl_R; /* CTRL-R CTRL-O == CTRL-R CTRL-R */
1183 if (i == Ctrl_R) 1184 if (i == Ctrl_R)
1757 case Ctrl_Q: 1758 case Ctrl_Q:
1758 #ifdef FEAT_MOUSE 1759 #ifdef FEAT_MOUSE
1759 ignore_drag_release = TRUE; 1760 ignore_drag_release = TRUE;
1760 #endif 1761 #endif
1761 putcmdline('^', TRUE); 1762 putcmdline('^', TRUE);
1762 extra_char = '^';
1763 c = get_literal(); /* get next (two) character(s) */ 1763 c = get_literal(); /* get next (two) character(s) */
1764 do_abbr = FALSE; /* don't do abbreviation now */ 1764 do_abbr = FALSE; /* don't do abbreviation now */
1765 extra_char = NUL; 1765 extra_char = NUL;
1766 #ifdef FEAT_MBYTE 1766 #ifdef FEAT_MBYTE
1767 /* may need to remove ^ when composing char was typed */ 1767 /* may need to remove ^ when composing char was typed */
1778 case Ctrl_K: 1778 case Ctrl_K:
1779 #ifdef FEAT_MOUSE 1779 #ifdef FEAT_MOUSE
1780 ignore_drag_release = TRUE; 1780 ignore_drag_release = TRUE;
1781 #endif 1781 #endif
1782 putcmdline('?', TRUE); 1782 putcmdline('?', TRUE);
1783 extra_char = '?';
1784 #ifdef USE_ON_FLY_SCROLL 1783 #ifdef USE_ON_FLY_SCROLL
1785 dont_scroll = TRUE; /* disallow scrolling here */ 1784 dont_scroll = TRUE; /* disallow scrolling here */
1786 #endif 1785 #endif
1787 c = get_digraph(TRUE); 1786 c = get_digraph(TRUE);
1788 extra_char = NUL; 1787 extra_char = NUL;
2943 msg_putchar(c); 2942 msg_putchar(c);
2944 if (shift) 2943 if (shift)
2945 draw_cmdline(ccline.cmdpos, ccline.cmdlen - ccline.cmdpos); 2944 draw_cmdline(ccline.cmdpos, ccline.cmdlen - ccline.cmdpos);
2946 msg_no_more = FALSE; 2945 msg_no_more = FALSE;
2947 cursorcmd(); 2946 cursorcmd();
2947 extra_char = c;
2948 extra_char_shift = shift;
2948 } 2949 }
2949 2950
2950 /* 2951 /*
2951 * Undo a putcmdline(c, FALSE). 2952 * Undo a putcmdline(c, FALSE).
2952 */ 2953 */
2965 #endif 2966 #endif
2966 else 2967 else
2967 draw_cmdline(ccline.cmdpos, 1); 2968 draw_cmdline(ccline.cmdpos, 1);
2968 msg_no_more = FALSE; 2969 msg_no_more = FALSE;
2969 cursorcmd(); 2970 cursorcmd();
2971 extra_char = NUL;
2970 } 2972 }
2971 2973
2972 /* 2974 /*
2973 * Put the given string, of the given length, onto the command line. 2975 * Put the given string, of the given length, onto the command line.
2974 * If len is -1, then STRLEN() is used to calculate the length. 2976 * If len is -1, then STRLEN() is used to calculate the length.
3416 msg_clr_eos(); 3418 msg_clr_eos();
3417 msg_no_more = FALSE; 3419 msg_no_more = FALSE;
3418 3420
3419 set_cmdspos_cursor(); 3421 set_cmdspos_cursor();
3420 if (extra_char != NUL) 3422 if (extra_char != NUL)
3421 putcmdline(extra_char, TRUE); 3423 putcmdline(extra_char, extra_char_shift);
3422 3424
3423 /* 3425 /*
3424 * An emsg() before may have set msg_scroll. This is used in normal mode, 3426 * An emsg() before may have set msg_scroll. This is used in normal mode,
3425 * in cmdline mode we can reset them now. 3427 * in cmdline mode we can reset them now.
3426 */ 3428 */