aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-12-01 09:57:49 +1000
committerGravatar axel <axel@liljencrantz.se>2006-12-01 09:57:49 +1000
commitde181c91d5004574bcb6956fa42a66e93d6f170a (patch)
tree3d85b70b0504be9de9ef77aea3a192f7a0db544d /reader.c
parent687ba1c9efb4f57d2aa948b8bb2cea4bcfd5c7fa (diff)
Only flash commandline, not entire screen, when completion fails
darcs-hash:20061130235749-ac50b-436e5619f7818db7660269545de19e21c6a7e1b8.gz
Diffstat (limited to 'reader.c')
-rw-r--r--reader.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/reader.c b/reader.c
index d29d5010..2e3d1f4c 100644
--- a/reader.c
+++ b/reader.c
@@ -37,6 +37,7 @@ commence.
#include <sys/ioctl.h>
#endif
+#include <time.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <sys/poll.h>
@@ -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; i<data->buff_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 )