From a89270b2be310c4255e9baa9a22966d3cd8ed9c8 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 24 Apr 2016 12:56:59 +0100 Subject: libbb/lineedit: only clear to EOL when deleting character When the console buffer is large clearing to the end of the buffer slows deletion noticeably. Only clear to end of line. --- libbb/lineedit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libbb') diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 04361b509..9f96d4a0b 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -110,7 +110,7 @@ static bool BB_ispunct(CHAR_T c) { return ((unsigned)c < 256 && ispunct(c)); } #define ESC "\033" #define SEQ_CLEAR_TILL_END_OF_SCREEN ESC"[J" -//#define SEQ_CLEAR_TILL_END_OF_LINE ESC"[K" +#define SEQ_CLEAR_TILL_END_OF_LINE ESC"[K" enum { @@ -611,7 +611,7 @@ static void input_delete(int save) command_len--; put_till_end_and_adv_cursor(); /* Last char is still visible, erase it (and more) */ - printf(SEQ_CLEAR_TILL_END_OF_SCREEN); + printf(SEQ_CLEAR_TILL_END_OF_LINE); input_backward(cursor - j); /* back to old pos cursor */ } -- cgit v1.2.3-55-g6feb