nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] Future of incremental search


From: Brand Huntsman
Subject: Re: [Nano-devel] Future of incremental search
Date: Fri, 16 Feb 2018 17:49:44 -0700

On Fri, 16 Feb 2018 10:30:26 -0200
Marco Diego Aurélio Mesquita <address@hidden> wrote:

> with incremental search, a few keystrokes is all I need

There are so many cases where only a few characters are needed to find 
something, but normal search requires typing the entire word or opening the 
prompt again to enter more characters.

It would be nice if the "[Incremental]" could be hidden from the prompt if 
always enabled in nanorc. And in that case, if M-I is used to turn off 
inc-search, then display "[Non-Incremental]" or something. If done right 
(behaves just like normal search), I see no reason why it shouldn't always be 
enabled and not have the option to enable or disable it.


> It looks like the problems pointed in [2] are easy to fix, except the
> triple click one.

^K^U that line and then ^U in the prompt works, the linefeed is ignored so the 
prompt doesn't close. But pasting interprets the linefeed different some how 
and closes the prompt

Put this after the declarations in search_text():
fprintf(stderr, "%d [%s]\n", modus, needle);

Run `src/nano NEWS 2>TRAIL;cat TRAIL` for the following cases:

^W M-I ^C quit
1 []
3 []
2 []

^END up-arrow ^K^U ^HOME ^W M-I ^U quit
1 []
3 []
3 [             jazz.]
2 [             jazz.]

^END, triple-click the "jazz" line, ^HOME ^W M-I, paste and quit. There
are 18 characters in that line, excluding the linefeed and 18 empty
calls to seearch_text() with modus=SEARCH_FROM_START, excluding the 1
empty call that always happens when the prompt is opened. And
modus=RESTORE_POSITION never happens.

Now double-click the word "jazz" and paste into incremental search. Why are 
there 5 empty calls with SEARCH_FROM_START?
1 []
3 []
3 []
3 []
3 []
3 []
3 [jazz.]
2 [jazz.]

Hopefully that helps you find the problem.


> My current plan is to wait until the "errcolor"
> lands, fix the problems in [2] and send another iteration of the
> patch.

I see no reason to wait for errorcolor, it will only improve non-match 
recognition for those with color. Unhighlighting the last match and displaying 
"[NOT FOUND]" in the prompt should be enough for now.


> /* Repostion the cursor */

Missing an 'i'.




reply via email to

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