X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=selector.c;h=3b68b47611ed380451adf90eadd1d4bd2cfc72bd;hb=8d9de92b641cae8302bbfe9681c487bfea9401f8;hp=5f6203d218df820ecfc88d51460b139cfbe21171;hpb=7766119933219cac9ff380a677c8ca721e9dac0d;p=selector.git diff --git a/selector.c b/selector.c index 5f6203d..3b68b47 100644 --- a/selector.c +++ b/selector.c @@ -603,32 +603,24 @@ void update_screen(int *current_focus_line, int *displayed_focus_line, if(match(&matcher, lines[l])) { int k = 0; - while(lines[l][k] && k < BUFFER_SIZE - 2 && k < console_width - 2) { + while(lines[l][k] && k < BUFFER_SIZE - 2 && k < console_width) { buffer[k] = lines[l][k]; k++; } - /* We fill the rest of the line with blanks if this is the - highlighted line */ + /* Highlight the highlighted line ... */ if(l == new_focus_line) { while(k < console_width) { buffer[k++] = ' '; } - } - - buffer[k++] = '\n'; - buffer[k++] = '\0'; - - clrtoeol(); - - /* Highlight the highlighted line ... */ - - if(l == new_focus_line) { attron(attr_focus_line); addnstr(buffer, console_width); attroff(attr_focus_line); } else { + buffer[k++] = '\n'; + buffer[k++] = '\0'; + /* clrtoeol(); */ addnstr(buffer, console_width); }