mirror of
https://github.com/troglobit/editline.git
synced 2025-05-06 04:21:24 +08:00
Follow-up to a4b67d2
: Ctrl-L redisplay line when not on empty line
Like Ctrl-D, when on an empty line we clear the screen, when editing a garbled line we refresh the line. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
parent
c95d25731d
commit
979f05a5eb
@ -538,8 +538,11 @@ int rl_insert_text(const char *text)
|
|||||||
|
|
||||||
static el_status_t redisplay(void)
|
static el_status_t redisplay(void)
|
||||||
{
|
{
|
||||||
/* XXX: Use "\r\e[K" to get really neat effect on ANSI capable terminals. */
|
if (rl_point == 0)
|
||||||
tty_puts(CLEAR);
|
tty_puts(CLEAR);
|
||||||
|
else
|
||||||
|
tty_puts("\r\e[K");
|
||||||
|
|
||||||
tty_puts(rl_prompt);
|
tty_puts(rl_prompt);
|
||||||
tty_string(rl_line_buffer);
|
tty_string(rl_line_buffer);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user