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: David Ramsey
Subject: Re: [Nano-devel] [PATCH] Implement incremental search
Date: Mon, 12 Feb 2018 14:27:09 -0600

On Fri, Feb 9, 2018 at 4:44 PM, Benno Schulenberg <address@hidden>
wrote:
> 1) Run src/nano +1 NEWS, and type: ^W M-I unco <Enter> <Down>. The
> cursor should stay in the same column, but it jumps back to the left
> edge.
>
> 2) Run src/nano +1 NEWS, and type: ^W M-I but <Enter> ^W but The
> incremental search finds the occurrence at the cursor; I don't find
> that useful.  Gedit and Emacs work like that, but Vim doesn't.  I
> prefer the behavior of Vim in this case.
>
> 3) Run src/nano +1 NEWS and type: ^W but M-W <Enter> The M-W
> highlights the first occurrence after the starting position, the
> <Enter> jumps to the second occurrence.  The latter is unexpected,
> because normally, when something is highlighted, during incremental
> search, pressing <Enter> leaves the cursor at that place.  I think
> <Enter> should always leave the cursor at the highlighted spot.
>
> The upcoming patch corrects those three things, besides changing some
> other stuff.

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).

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?

As for whether I want this feature... I'm ambivalent.  I would find this
useful occasionally, if I'm trying to find partial matches for
something, but it wouldn't be something I'd use regularly.



reply via email to

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