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 v6


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


Op 06-02-18 om 03:44 schreef Marco Diego Aurélio Mesquita:
On Sun, Feb 4, 2018 at 3:04 PM, Benno Schulenberg <address@hidden>
wrote:
M-B  <Backspace>  <Backspace> The screen should jump back, first to the
first occurrence of "Th", then to the first occurrence of "T", in the
forwards direction from the original starting point.  Vim and Emacs jump
back when the search string is shortened; nano should behave the same way.

I spent some time thinking about how to implement this behaviour. It is a
little more complicated than I initially thought. Been able to use M-W (search
next occurrence) while in incremental search complicates things;

It shouldn't.  The searchnext when in Incremental will be a bit difficult,
but the incremental search itself should not be affected: every keystroke
(every new character or deleted character) should cause a search from the
original starting position.

gedit behaves similar to vim and it has a search next while in incremental
search, but it has it own quirks too: it looks like every new key is re-searched from the initial point where the search was started,

That's how it should be.

regardless of how many "search next"'s you fired;

The searchnext serves to look ahead so you can decide to either pick
the found occurrence (Enter), or type some more characters to narrow
the search, and then it should of course start from the the original
starting point.  (You could start from the occurrence that was found
first, but that just complicates matters.)

another quirk is that an empty prompt always returns to the initial search
position.

That's also how it should be: the empty string is found right there,
at the starting position.  Also: when you start an incremental search,
the answer is empty; so when the answer is empty again, you should be
back at the starting point.

Should I implement it the "gedit"-way?

Yes.

Benno



reply via email to

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