Start counting nb_printed_lines from 0
[selector.git] / selector.cc
index c387c68..f4d7930 100644 (file)
@@ -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);