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: Sun, 4 Feb 2018 18:04:03 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0


Op 03-02-18 om 06:51 schreef Marco Diego Aurélio Mesquita:
Differences from previous version:
  - Incremental search was removed from "find in help" and "replace".
  - Problems with regexp were fixed.

I'm still using a loop on do_search.

You don't get it.  When I say you should remove something, *remove* it:
I don't want to see it, it is unacceptable.  Solve the problems in a
different way.

The mutual recursion (with both
self recursive functions) between do_search and do_replace gets hairy.

True.  The patch that I am about to post should make things easier for
you -- it gets rid of part of the recursion.

It is not the final version of the patch.  And the whitespace will be
corrected in a subsequent patch, and two variables renamed, and some
things reshuffled.  But the basic idea will be clear.  Please inspect
it, and if you see any problem, please holler.

For example, the loop nicely handles the following situation: ^W M-I
dam M-W ^R ^C.
To follow your example, run 'src/nano +1 NEWS' and type:
  ^W  M-I  dam  ^R
The prompt still shows "[Incremental]".  It shouldn't.
Type ^R again to return to searching. The screen should jump to the
first occurrence of "dam" and highlight it, but it stays put at the
top.

Further things that go wrong.  Run 'src/nano +1 NEWS' and type:
  ^W  The  M-I
The first occurrence of "the" does not get highlighted.  It should.
  <Backspace>  e
Now it does get highlighted.  Good.
  M-C
The screen should jump to the first occurrence of "The", with a
capital.  But it doesn't.
  M-B
The screen should jump to the first occurrence of "The" in the
backwards direction, from the original starting point.  But it
doesn't.
  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.

Benno



reply via email to

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