nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] [PATCH] Implement incremental search


From: Benno Schulenberg
Subject: Re: [Nano-devel] [PATCH] Implement incremental search
Date: Tue, 13 Feb 2018 19:38:26 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0


Op 12-02-18 om 21:27 schreef David Ramsey:
I've tested this, and there's one odd behavior I've noticed as well. Note
that my only experience with incremental search is through Mozilla Firefox;
I'm not sure if this is what gedit/vim does (since I don't use either).

1. With the patch applied, run:

src/nano +1 README

2. Press Ctrl-W to get to the search prompt, and press Meta-I to turn on incremental search mode.

3. Type "but " (minus the quotes).

On the "b", nano highlights the "b" in the first instance of "because" (expected). On the "u", nano highlights the "bu" in the first instance of "redistribution" (expected). On the "t", nano highlights the "but" in the same instance of "redistribution" (expected). On the " ", nano leaves "but" in the same instance of "redistribution" highlighted, despite the fact that "but " doesn't occur anywhere in the file (not expected, in that the previous match is still highlighted).

This is what I wanted.  Vim jumps back to where to search started when
you type something that cannot be found -- this is logically correct, but
I don't like the jump without any other feedback that the search failed.
Emacs leaves the last found thing highlighted as it was when you type
something that cannot be found, just like nano now does with the patch,
but it changes the prompt from "I-search" to "Failing I-search", and
highlights the character(s) in the answer that cannot be matched, and
beeps.

I know that moving through the file via incremental search is indeed what is supposed to happen, but shouldn't there be some indication when the user goes from a match to a non-match, to avoid confusion?

The only indication currently is a beep, audio.  It would be nice if
the prompt changed, or the color of the prompt bar, or both.  But that
is going to make the patch more complicated.  For me, personally, the
beep is enough, and not seeing the highlight jump when you type another
character is a tell-tale sign too that there is no match.

As for whether I want this feature... I'm ambivalent.

Yes, ambivalent, that's what I am too.  It's a nice feature, but...
unnecessary.  This is something that I would hide behind a compile
flag, --enable-extra.

Benno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]