//////////////////////////////////////////////////////////////////////
-// int test_and_set_hash(char *s, char **hashed, int hash_size) {
- // uint32_t code = 0, mask;
- // int result;
-
- // for(int k = 0; s[k]; k++) {
- // code += ((uint32_t) (s[k])) << (8 * k%4);
- // }
-
- // code = code%hash_table_size;
-
- // if(hashed[code]) {
- // } else {
- // }
-// }
-
-//////////////////////////////////////////////////////////////////////
-
// This looks severely Linux-only ...
void inject_into_tty_buffer(char *line) {
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
*temporary_line = new_line;
- if(nb_printed_lines == 1) {
+ if(nb_printed_lines == 0) {
addnstr("[no selection]\n", console_width);
- nb_printed_lines++;
}
// Draw the modeline
sprintf(buffer, "%d/%d pattern: %s",
- nb_printed_lines - 1,
+ nb_printed_lines,
nb_lines,
pattern_list);