From 94043e8ad2d30cc2199b35d18c853314ade174a3 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 11 May 2010 14:49:13 +0200 Subject: lineedit: change how cmdedit_set_out_char works Rename two badly names functions, use "clear to end of screen" to eliminate annoying problems with clearing wide/combining chars, and such. Run tested. function old new delta put_cur_glyph_and_inc_cursor - 124 +124 put_till_end_and_adv_cursor - 24 +24 input_delete 125 130 +5 Ceos 5 4 -1 Ceol 5 4 -1 input_end 24 - -24 cmdedit_set_out_char 122 - -122 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 1/2 up/down: 153/-148) Total: 5 bytes Signed-off-by: Denys Vlasenko --- editors/vi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'editors') diff --git a/editors/vi.c b/editors/vi.c index d3a35e781..b8cacb43f 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -65,8 +65,8 @@ static const char SOn[] ALIGN1 = "\033[0m"; /* terminal bell sequence */ static const char bell[] ALIGN1 = "\007"; /* Clear-end-of-line and Clear-end-of-screen ESC sequence */ -static const char Ceol[] ALIGN1 = "\033[0K"; -static const char Ceos[] ALIGN1 = "\033[0J"; +static const char Ceol[] ALIGN1 = "\033[K"; +static const char Ceos[] ALIGN1 = "\033[J"; /* Cursor motion arbitrary destination ESC sequence */ static const char CMrc[] ALIGN1 = "\033[%d;%dH"; /* Cursor motion up and down ESC sequence */ -- cgit v1.2.3