patchGNU nano - Patches: patch #9268, fix spotlight() to highlight words...

 
 

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

patch #9268: fix spotlight() to highlight words properly in softwrap mode

Submitter:  David Lawrence Ramsey <dolorous>
Submitted:  Fri 24 Feb 2017 05:35:21 AM UTC
   
 
Priority:  7 - High Status:  Done
Privacy:  Public Assigned to:  dolorous
Open/Closed:  Closed Release:  None

Fri 24 Feb 2017 05:35:21 AM UTC, original submission:  

In current git, spotlight() always assumes we're not in softwrap mode, even when that isn't the case, and doesn't highlight words at the edges of the screen properly as a result.  An example problem can be reproduced as follows:

1. In an 80x24 terminal, run "nano --ignore --softwrap spotlight-test.txt" (the file is attached).

2. Press Ctrl-W Ctrl-R to get the replace prompt.

3. Attempt to replace "80x24" with "????".  The first (and only) "80x24" will be highlighted wrongly.  Even though it's spread across two lines, to make one line end in "80" and the line after that begin with "x24", the highlight will display "8$" on the first line and not display anything highlighted on the second line, since it assumes non-softwrap mode's horizontal scrolling.

The attached patch fixes this by making softwrap mode use all of the word's columns, since they should all be visible (and also saves the value of xplustabs() in a variable, to avoid calling it twice in non-softwrap mode).  Since the "$" display only triggers if there aren't enough columns for the word, it's never used in softwrap mode, as intended.

David Lawrence Ramsey <dolorous>
Group Member

 

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Updated the item)
  • -email is unavailable- added by dolorous (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-04-02 bens Priority5 - Normal 7 - High
        Open/ClosedOpen Closed
    2017-02-24 bens StatusNone Done
        Assigned toNone dolorous
    2017-02-24 dolorous Attached File- Added spotlight-test.txt, #39818
        Attached File- Added 0001-replace-fix-spotlight-to-highlight-words-properly-in.patch, #39819

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code