From de181c91d5004574bcb6956fa42a66e93d6f170a Mon Sep 17 00:00:00 2001 From: axel Date: Fri, 1 Dec 2006 09:57:49 +1000 Subject: [PATCH] Only flash commandline, not entire screen, when completion fails darcs-hash:20061130235749-ac50b-436e5619f7818db7660269545de19e21c6a7e1b8.gz --- reader.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/reader.c b/reader.c index d29d50109..2e3d1f4c2 100644 --- a/reader.c +++ b/reader.c @@ -37,6 +37,7 @@ commence. #include #endif +#include #include #include #include @@ -1028,6 +1029,35 @@ static void run_pager( wchar_t *prefix, int is_quoted, array_list_t *comp ) io_buffer_destroy( in); } +/* + Flash the screen. This function only changed the color of the + current line, since the flash_screen sequnce is rather painful to + look at in most terminal emulators. +*/ +static void reader_flash() +{ + struct timespec pollint; + + int i; + + for( i=0; ibuff_pos; i++ ) + { + data->color[i] = HIGHLIGHT_SEARCH_MATCH<<16; + } + + repaint(); + + pollint.tv_sec = 0; + pollint.tv_nsec = 100 * 1000000; + nanosleep( &pollint, NULL ); + + reader_super_highlight_me_plenty( data->buff_pos, 0 ); + repaint(); + + +} + + /** Handle the list of completions. This means the following: @@ -1050,8 +1080,7 @@ static int handle_completions( array_list_t *comp ) if( al_get_count( comp ) == 0 ) { - if( flash_screen != 0 ) - writembs( flash_screen ); + reader_flash(); return 0; } else if( al_get_count( comp ) == 1 )