X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=selector.git;a=blobdiff_plain;f=selector.c;h=8f2296b0bbab65903f6370212fc2526b69156ac1;hp=041de4c524a8b99e73608992b972cc90018e7bee;hb=f468bac37e858012db8829272f84422ab4732291;hpb=cbee09d3edf6ada10197acf59b0243271d31c3c0 diff --git a/selector.c b/selector.c index 041de4c..8f2296b 100644 --- a/selector.c +++ b/selector.c @@ -25,7 +25,7 @@ /* To use it as a super-history-search for bash: - selector -q -b -i -d -v -w -l ${HISTSIZE} <(history) + selector --bash -l ${HISTSIZE} <(history) */ @@ -428,8 +428,7 @@ void kill_after_cursor(char *buffer, int *position) { /*********************************************************************/ -int previous_visible(int current_line, int nb_lines, char **lines, - matcher_t *matcher) { +int previous_visible(int current_line, char **lines, matcher_t *matcher) { int line = current_line - 1; while(line >= 0 && !match(lines[line], matcher)) line--; return line; @@ -502,8 +501,7 @@ void update_screen(int *current_focus_line, int *displayed_focus_line, new_focus_line = next_visible(*current_focus_line, nb_lines, lines, &matcher); if(new_focus_line < 0) { - new_focus_line = previous_visible(*current_focus_line, nb_lines, lines, - &matcher); + new_focus_line = previous_visible(*current_focus_line, lines, &matcher); } } @@ -522,7 +520,7 @@ void update_screen(int *current_focus_line, int *displayed_focus_line, } else { /* We want to go up, let's find the first visible line above */ for(m = 0; l >= 0 && m < -motion; m++) { - l = previous_visible(l, nb_lines, lines, &matcher); + l = previous_visible(l, lines, &matcher); if(l >= 0) { new_focus_line = l; }