@@ -3107,7 +3107,7 @@ check_end_reg_executing(int advance)
31073107 static int
31083108vgetorpeek (int advance )
31093109{
3110- int c , c1 ;
3110+ int c ;
31113111 int timedout = FALSE; // waited for more than 'timeoutlen'
31123112 // for mapping to complete or
31133113 // 'ttimeoutlen' for complete key code
@@ -3474,7 +3474,7 @@ vgetorpeek(int advance)
34743474 * to the user with showcmd.
34753475 */
34763476 showcmd_idx = 0 ;
3477- c1 = 0 ;
3477+ int showing_partial = FALSE ;
34783478 if (typebuf .tb_len > 0 && advance && !exmode_active )
34793479 {
34803480 if (((State & (MODE_NORMAL | MODE_INSERT ))
@@ -3489,7 +3489,7 @@ vgetorpeek(int advance)
34893489 edit_putchar (typebuf .tb_buf [typebuf .tb_off
34903490 + typebuf .tb_len - 1 ], FALSE);
34913491 setcursor (); // put cursor back where it belongs
3492- c1 = 1 ;
3492+ showing_partial = TRUE ;
34933493 }
34943494 // need to use the col and row from above here
34953495 old_wcol = curwin -> w_wcol ;
@@ -3506,8 +3506,10 @@ vgetorpeek(int advance)
35063506 curwin -> w_wrow = old_wrow ;
35073507 }
35083508
3509- // this looks nice when typing a dead character map
3509+ // This looks nice when typing a dead character map.
3510+ // There is no actual command line for get_number().
35103511 if ((State & MODE_CMDLINE )
3512+ && get_cmdline_info ()-> cmdbuff != NULL
35113513#if defined(FEAT_CRYPT ) || defined(FEAT_EVAL )
35123514 & & cmdline_star == 0
35133515#endif
@@ -3516,7 +3518,7 @@ vgetorpeek(int advance)
35163518 {
35173519 putcmdline (typebuf .tb_buf [typebuf .tb_off
35183520 + typebuf .tb_len - 1 ], FALSE);
3519- c1 = 1 ;
3521+ showing_partial = TRUE ;
35203522 }
35213523 }
35223524
@@ -3550,11 +3552,12 @@ vgetorpeek(int advance)
35503552
35513553 if (showcmd_idx != 0 )
35523554 pop_showcmd ();
3553- if (c1 == 1 )
3555+ if (showing_partial )
35543556 {
35553557 if (State & MODE_INSERT )
35563558 edit_unputchar ();
3557- if (State & MODE_CMDLINE )
3559+ if ((State & MODE_CMDLINE )
3560+ && get_cmdline_info ()-> cmdbuff != NULL )
35583561 unputcmdline ();
35593562 else
35603563 setcursor (); // put cursor back where it belongs
0 commit comments