[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH 3/3] less: Clear search-highlight if no matches
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2014-01-23 11:10:36
Message-ID: CAK1hOcOi_xh9V8_CcrkazJOkZqjB77nseGBL88pyLZ8SCHfu_w () mail ! gmail ! com
[Download RAW message or body]

On Tue, Jan 21, 2014 at 6:58 PM, Bernhard Reutner-Fischer
<rep.dot.nop@gmail.com> wrote:
> When looking at a file containing a word "foo", searching for foo
> highlights the word. Now search for "asddsa" (no match), we are supposed
> to clear the highlight of the previous foo, not key it off the validity
> of the regex.
> This makes the highlight disappear at least on the next redraw..
>
> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
> ---
>  miscutils/less.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/miscutils/less.c b/miscutils/less.c
> index cd553f6..6e187e6 100644
> --- a/miscutils/less.c
> +++ b/miscutils/less.c
> @@ -822,7 +822,7 @@ static void buffer_print(void)
>
>         move_cursor(0, 0);
>         for (i = 0; i <= max_displayed_line; i++)
> -               if (pattern_valid)
> +               if (num_matches)
>                         print_found(buffer[i]);
>                 else
>                         print_ascii(buffer[i]);


I can not reproduce the bug: I follow your instructions
and everything works as expected:
highlights on all instances of "foo" disappeared
on the new redraw.
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic