-/* $OpenBSD: vi.c,v 1.57 2020/09/20 14:40:45 millert Exp $ */
+/* $OpenBSD: vi.c,v 1.58 2021/03/10 20:06:04 millert Exp $ */
/*
* vi command editing
static int grabhist(int, int);
static int grabsearch(int, int, int, char *);
static void do_clear_screen(void);
-static void redraw_line(int);
+static void redraw_line(int, int);
static void refresh_line(int);
static int outofwin(void);
static void rewindow(void);
break;
case CTRL('r'):
- redraw_line(1);
+ redraw_line(1, 0);
break;
case '@':
neednl = 0;
}
#endif
- redraw_line(neednl);
+ /* Only print the full prompt if we cleared the screen. */
+ redraw_line(neednl, !neednl);
}
static void
-redraw_line(int neednl)
+redraw_line(int neednl, int full)
{
(void) memset(wbuf[win], ' ', wbuf_len);
if (neednl) {
x_putc('\r');
x_putc('\n');
}
- vi_pprompt(0);
+ vi_pprompt(full);
cur_col = pwidth;
morec = ' ';
}
vi_error();
x_print_expansions(nwords, words, is_command);
x_free_words(nwords, words);
- redraw_line(0);
+ redraw_line(0, 0);
return -1;
}
/*
}
x_print_expansions(nwords, words, is_command);
x_free_words(nwords, words);
- redraw_line(0);
+ redraw_line(0, 0);
return 0;
}