From: Francois Fleuret Date: Tue, 31 Mar 2009 19:46:45 +0000 (+0200) Subject: Removed a bug when the input file is empty. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=8eb6affd35f9c02dc6bfa5ec8319004bf6f8e78c;p=selector.git Removed a bug when the input file is empty. --- 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