From 64bc1ee1851a7846590107a3ea86893a137f1be8 Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 21 Jan 2019 05:43:25 +0100 Subject: Edit instead of remplace --- readline.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'readline.c') diff --git a/readline.c b/readline.c index 523d7d7..d9bf8e3 100644 --- a/readline.c +++ b/readline.c @@ -172,9 +172,14 @@ void init_readline(void) } -void readline_n(void) { +void readline_n(const char* str) { curs_set(2); resize(); + for( ; *str ; str++ ) { + if( *str != '\n' && *str != '\f' && *str != KEY_RESIZE ) { + forward_to_readline(*str); + } + } while (!should_exit) { // Using getch() here instead would refresh stdscr, overwriting the // initial contents of the other windows on startup @@ -197,5 +202,3 @@ void readline_n(void) { should_exit = 0; } - - -- cgit v1.2.3