X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=selector.cc;h=0cd620a44e484104bd26031f38c9a5ecc642efb1;hb=e95ec6b1b98bdcb33a296c01af5c15c9f2192834;hp=a6d3d7e5d072e1d41b96465e303b60258b156445;hpb=87e22fcdf5fe0824932f2d259bd8969ea7d88092;p=selector.git diff --git a/selector.cc b/selector.cc index a6d3d7e..0cd620a 100644 --- a/selector.cc +++ b/selector.cc @@ -73,7 +73,7 @@ void inject_into_tty_buffer(char *string) { const char control_q = '\021'; // Put the selected string in the tty input buffer for(const char *k = string; *k; k++) { - if(add_control_qs) { + if(add_control_qs && !(*k >= ' ' && *k <= '~')) { // Add ^Q to quote control characters ioctl(STDIN_FILENO, TIOCSTI, &control_q); } @@ -349,7 +349,6 @@ void update_screen(int *current_line, int *temporary_line, int motion, int nb_printed_lines = 0; - clear(); use_default_colors(); addstr("\n"); @@ -445,6 +444,8 @@ void update_screen(int *current_line, int *temporary_line, int motion, buffer[k++] = '\n'; buffer[k++] = '\0'; + clrtoeol(); + // Highlight the highlighted line ... if(l == new_line) { @@ -479,6 +480,8 @@ void update_screen(int *current_line, int *temporary_line, int motion, addnstr("[empty choice]\n", console_width); } + clrtobot(); + // Draw the modeline move(0, 0); @@ -996,6 +999,11 @@ int main(int argc, char **argv) { kill_after_cursor(pattern, &cursor_position); } + else if(key == '\014') { // ^L + // I suspect that we may sometime mess up the display + clear(); + } + update_screen(¤t_line, &temporary_line, motion, nb_lines, labels, cursor_position, pattern);