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: Benno Schulenberg
Subject: Re: [Nano-devel] [PATCH] Implement incremental search
Date: Fri, 9 Feb 2018 19:44:53 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0


The patch seems to work well.  Except for these things.

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.

Op 08-02-18 om 03:49 schreef Marco Diego Aurélio Mesquita:
+       bool didfind, was_full_circle = came_full_circle;

Can you give an example where it is necessary that came_full_circle
is restored to its previous value?

+       if (ISSET(USE_REGEXP))
+               regexp_cleanup();

Is it not enough that the regex is cleaned up when the user
exits from the search prompt?

+               /* Handle some cases where we have to search again. */
+               if(ISSET(INCREMENTAL_SEARCH) && (func == case_sens_void ||
+                                                                               
 func == backwards_void ||
+                                                                               
 func == regexp_void    ||
+                                                                               
 func == inc_search_void)) {
+                       search_text(answer, SEARCH_FROM_START);
+               }

Still not looking good.  A reworking patch (on top of yours)
is coming up.

+       /* Unmark highlighted text. */
+       if (didfind && ISSET(INCREMENTAL_SEARCH))
+               highlight(FALSE, 0);

A strange place to do this -- in go_looking().

Benno



reply via email to

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