From: Olivier Bornet Date: Mon, 16 Mar 2009 08:12:21 +0000 (+0100) Subject: Start counting nb_printed_lines from 0 X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=ef2a722e9da6dc7486797d1324da95e0a88138cf;p=selector.git Start counting nb_printed_lines from 0 It's more understandable to have nb_printed_lines starting at 0, and to use directly instead of using nb_printed_lines + 1 after that. Signed-off-by: Francois Fleuret --- diff --git a/selector.cc b/selector.cc index c387c68..f4d7930 100644 --- a/selector.cc +++ b/selector.cc @@ -208,7 +208,7 @@ void update_screen(int *current_line, int *temporary_line, int motion, addstr("\n"); - int nb_printed_lines = 1; + int nb_printed_lines = 0; // Here new_line is either a line number matching the patterns, or -1 @@ -293,14 +293,14 @@ void update_screen(int *current_line, int *temporary_line, int motion, *temporary_line = new_line; - if(nb_printed_lines == 1) { + if(nb_printed_lines == 0) { addnstr("[no selection]\n", console_width); } // Draw the modeline sprintf(buffer, "%d/%d pattern: %s", - nb_printed_lines - 1, + nb_printed_lines, nb_lines, pattern_list);