bugGNU nano - Bugs: bug #54906, [Request] highlight all onscreen...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #54906: [Request] highlight all onscreen matches of the search string

Submitter:  -X- <astier>
Submitted:  Sun 28 Oct 2018 06:14:24 PM UTC
   
 
Severity:  1 - Wish Status:  Wont Fix
Assigned to:  None Open/Closed:  Closed

Discussion locked!

Jump to the original submission

Tue 29 Dec 2020 03:10:20 PM UTC, comment #8: 

(Highlighting all occurrences when the question in the status bar is "Replace this occurrence?" would be rather confusing.)

Please don't post to closed issues.  This is marked wontfix for  a reason: it's too complicated to make.  But you are free to post a patch (on the devel list) if you have made one.

Benno Schulenberg <bens>
Group administrator
Tue 29 Dec 2020 02:24:32 AM UTC, comment #7: 

May I suggest a possible compromise?

As you noted, highlighting already takes place when performing replacement, but it only highlights the current match. If during the replacement process all occurences were highlighted rather than just the current one (possibly using a different colour than the currently selected match for replacement), then that would resolve this issue very nicely.

If that is easier to implement, I would be more than happy using the replacement facility as a workaround for highlighting matches, rather than using search, which I agree would be more complicated to define exact behaviour for.

I agree this is a key missing feature from an otherwise excellent editor. At the moment, my workaround for highlighting matches is to open the file in another terminal, pass it to less, perform a search there, and then try to align the terminals side-by-side. I'm sure you'll agree this is an atrocious way of doing it xD


PS. Don't mean to sound ungrateful -- thank you so much for all the great work! I've just downloaded the latest release and loving the improvements!

Tasos Papastylianou <tpapastylianou>
Mon 31 Dec 2018 01:18:47 PM UTC, comment #6: 

Not going to make this.  It's too hard.

Benno Schulenberg <bens>
Group administrator
Mon 29 Oct 2018 06:16:49 PM UTC, comment #5: 

That's exactly what I want. I mean it's just a suggestion which I and probably some other people would find useful. But the last word is yours.

-X- <astier>
Mon 29 Oct 2018 04:58:12 PM UTC, comment #4: 

Aaah.  You want all matches to be highlighted -- at least: the ones that are onscreen.  And you probably want the other matches to be highligted too when you are paging up and down through the text, just like vim does?  And you would want the current match to be a different color than the other matches, just like in Firefox?

Oof...  That would be difficult to write in the current code base.  And would require a new keystroke (or maybe ^L could be used) to get rid of the highlights.  And it would require an option to turn this behavior on, because it cannot become the default (Pico doesn't do this, and the user wouldn't know how to get rid of the highlights again, they would be a nuisance).

Benno Schulenberg <bens>
Group administrator
Mon 29 Oct 2018 04:30:22 PM UTC, comment #3: 

The cursor would behave as usually. After the search-phrase is entered and enter is pressed it may jump to the next match. One can also jump the cursor to the next match as it is already implemented in the search/replace function.

My feature-request is only a visual one to help find matches visually quicker. The rest is exactly the same.

-X- <astier>
Mon 29 Oct 2018 04:21:44 PM UTC, comment #2: 

I mean that all search-matches in text are highlighted for example with a different background colour. Either when you press enter or in the dynamic case as you type your search-phrase at every key-stroke. Just as it possible in vim when your define the settings:

set hlsearch            " Highlight search-matches
set incsearch           " Highlight search-matches dynamically

Or like the search-function in firefox. Press Ctrl+F, enter your search-phrase and select at the bottom the option 'Highlight All'.

In order to remove the highlights of the matches one could define a key-combination.

I think this is a common feature in most programs where you have to work with text. It makes it easier to find all found matches in the text visually and much faster.

-X- <astier>
Mon 29 Oct 2018 03:54:58 PM UTC, comment #1: 

You are asking that nano, instead of just putting the cursor on the first character of the match, should highlight the entire matched search string?  Like it does when you do Search-and-Replace and it asks whether to replace this occurrence?

If so, where should the cursor be?  Should it be invisible?  Should it only reappear when <Enter> is pressed?  And when should the highlighting disappear?  As soon as a key is pressed?  And most of all: how can the user distinguish this search highlight from a mark highlight?

You see, it is possible to set the mark at some point, then search for something, so that nano will highlight everything between the point where the mark was set and the found occurrence.  Pressing M-W will extend the highlight to the next occurrence.  Having both a bunch of text and the match highlighted is bound to be confusing.

However, if you want incremental search (your bonus request), there is a patch for that.  See http://lists.gnu.org/archive/html/nano-devel/2018-07/msg00054.html and try it out.

Benno Schulenberg <bens>
Group administrator
Sun 28 Oct 2018 06:14:24 PM UTC, original submission:  

Feature: Highlight search-matches.
Bonus: Highlight search-matches dynamically as keys for the search-phrase are entered.

-X- <astier>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tpapastylianou (Posted a comment)
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by astier (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-12-29 bens Discussion LockNone Locked
    2019-03-10 bens Open/ClosedOpen Closed
    2018-12-31 bens StatusNone Wont Fix
    2018-10-29 bens Severity3 - Normal 1 - Wish
        StatusNeed Info None
        Summary[Request] highlight search matches [Request] highlight all onscreen matches of the search string
    2018-10-29 bens StatusNone Need Info
        SummaryFeature: Highlight search-matches [Request] highlight search matches

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code