From 8eb6affd35f9c02dc6bfa5ec8319004bf6f8e78c Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Tue, 31 Mar 2009 21:46:45 +0200 Subject: [PATCH] Removed a bug when the input file is empty. --- selector.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/selector.cc b/selector.cc index 3f8aba7..3ffccc1 100644 --- a/selector.cc +++ b/selector.cc @@ -228,8 +228,7 @@ void update_screen(int *current_line, int *temporary_line, int motion, if(matcher.regexp_error) { addstr("[regexp error]"); - } else { - + } else if(nb_lines > 0) { int new_line; if(match(lines[*current_line], &matcher)) { new_line = *current_line; @@ -349,6 +348,8 @@ void update_screen(int *current_line, int *temporary_line, int motion, if(nb_printed_lines == 0) { addnstr("[no selection]\n", console_width); } + } else { + addnstr("[empty choice]\n", console_width); } // Draw the modeline -- 2.39.5