[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] [PATCH] Implement incremental search v5
From: |
Benno Schulenberg |
Subject: |
Re: [Nano-devel] [PATCH] Implement incremental search v5 |
Date: |
Fri, 2 Feb 2018 11:18:22 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
Op 01-02-18 om 21:27 schreef Marco Diego Aurélio Mesquita:
The attached patch implements incremental search in nano. It addresses
complaints from the previous version.
Hrm! I said you should get rid of the do loop in do_search. But what
do you do? You add another one! -- No! Make your patch smaller, not
bigger. First make it work flawlessly for a single thing, and only then
maybe start thinking about extending it.
I had to change the behavior of do_replace so that is is now consistent with
the behavior of do_search.
No. I don't want to have incremental search when replacing something.
It doesn't make sense to me. And keep incremental search out of the
findinhelp too for now -- look how ugly it makes the help lines look.
Also, I didn't use the changes suggested by Benno on the previous revision
because I was still unhappy with the way do_right was used While fixing it,
some problems were found and then fixed.
Yes, using do_right() is not nice, but adding an unneeded loop is
far worse.
Please, give it a spin and review or commit it.
Commit it!? You are going way too fast!
A short spin: 'src/nano +1 NEWS', then type:
^W M-I ju.*
It beeps two times, correctly, because I forgot the regexp toggle.
So type:
M-R
Hm. It doesn't change the highlight to fit the changed situation.
Continue typing:
t\>
After the "t" it does update the highlight, after the "\" it beeps,
and after the ">" nothing changes, correctly. But now, type:
<Backspace>
The ">" is removed, but it takes a full second before the cursor
reappears and the beep occurs. Weird. Try it again: > <Backspace>
Same thing. Do it again: > <Backspace>
It again takes a second for the cursor to reappear, but now it
*doesn't* beep. Stranger and stranger... Do it again: > <Backspace>
Now the cursor reappears instantly and there is no beep.
What's going on there? Somewhere the error message from
regcomp ("Trailing backslash") gets eaten or suppressed
or overwritten. Apparently a failing regexp_init() needs
some different handling.
Benno