ins_ctrl_v()
{
int c;
+ int did_putchar = FALSE;
/* may need to redraw when no more chars available now */
ins_redraw(FALSE);
if (redrawing() && !char_avail())
+ {
edit_putchar('^', TRUE);
+ did_putchar = TRUE;
+ }
AppendToRedobuff((char_u *)CTRL_V_STR); /* CTRL-V */
#ifdef FEAT_CMDL_INFO
#endif
c = get_literal();
- edit_unputchar(); /* when line fits in 'columns' the '^' is at the start
- of the next line and will not be redrawn */
+ if (did_putchar)
+ /* when the line fits in 'columns' the '^' is at the start of the next
+ * line and will not removed by the redraw */
+ edit_unputchar();
#ifdef FEAT_CMDL_INFO
clear_showcmd();
#endif
{
int c;
int cc;
+ int did_putchar = FALSE;
pc_status = PC_STATUS_UNSET;
if (redrawing() && !char_avail())
ins_redraw(FALSE);
edit_putchar('?', TRUE);
+ did_putchar = TRUE;
#ifdef FEAT_CMDL_INFO
add_to_showcmd_c(Ctrl_K);
#endif
c = plain_vgetc();
--no_mapping;
--allow_keys;
- edit_unputchar(); /* when line fits in 'columns' the '?' is at the start
- of the next line and will not be redrawn */
+ if (did_putchar)
+ /* when the line fits in 'columns' the '?' is at the start of the next
+ * line and will not be removed by the redraw */
+ edit_unputchar();
if (IS_SPECIAL(c) || mod_mask) /* special key */
{
}
if (c != ESC)
{
+ did_putchar = FALSE;
if (redrawing() && !char_avail())
{
/* may need to redraw when no more chars available now */
if (char2cells(c) == 1)
{
- /* first remove the '?', otherwise it's restored when typing
- * an ESC next */
- edit_unputchar();
ins_redraw(FALSE);
edit_putchar(c, TRUE);
+ did_putchar = TRUE;
}
#ifdef FEAT_CMDL_INFO
add_to_showcmd_c(c);
cc = plain_vgetc();
--no_mapping;
--allow_keys;
- edit_unputchar(); /* when line fits in 'columns' the '?' is at the
- start of the next line and will not be redrawn */
+ if (did_putchar)
+ /* when the line fits in 'columns' the '?' is at the start of the
+ * next line and will not be removed by a redraw */
+ edit_unputchar();
if (cc != ESC)
{
AppendToRedobuff((char_u *)CTRL_V_STR);