From ef2a722e9da6dc7486797d1324da95e0a88138cf Mon Sep 17 00:00:00 2001 From: Olivier Bornet Date: Mon, 16 Mar 2009 09:12:21 +0100 Subject: [PATCH] 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 --- selector.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); -- 2.20.1