bugGNU nano - Bugs: bug #46511, when first switching to a buffer,...

 
 

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

bug #46511: when first switching to a buffer, nano should precalculate the colour info

Submitter:  Benno Schulenberg <bens>
Submitted:  Tue 24 Nov 2015 12:00:29 PM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Sun 20 Dec 2015 10:01:43 PM UTC, comment #3: 

Fixed in SVN, r5500.

Benno Schulenberg <bens>
Group administrator
Sat 19 Dec 2015 08:40:17 PM UTC, comment #2: 

Simple: when switching to a buffer, if the first line does not have any multidata yet, precalculate it for the whole file.

(file #35800)

Benno Schulenberg <bens>
Group administrator
Sat 19 Dec 2015 08:25:39 PM UTC, comment #1: 

The description of the problem is not fully correct: after hitting ^X, then hitting M-\ to go to the top of the file, things are coloured okay.  Only when paging upward with ^Y is most of the text coloured in the wrong, inverse manner.

Attached patch improves this, but there still remains some miscolouring.  The only solution is to do a precalculation, starting from the top of the file.  But I can't find an easy way to determine whether... [Ehm, of course I can; coming up in a minute!] whether the multidata has already been calculated, not without an extra element in the openfile struct.

(file #35799)

Benno Schulenberg <bens>
Group administrator
Tue 24 Nov 2015 12:00:29 PM UTC, original submission:  

Currently nano precalculates the multiline-regex colour info only for the first file given on the command line, not for the others.  For example, add these two lines to your ~/.nanorc:

syntax "tough"
color red start="\"" end="\""

Then run 'src/nano -Ytough  README  +68 NEWS'.

Hit ^X to close the first file, and see how NEWS is coloured in the inverse manner of what is intended by the syntax.  Hit M-\ to go to the top of the file, and see how only the first paragraph is coloured correctly, and things go wrong in the second line of the second paragraph.

Working its way backward from somewhere in the middles, it is hard for nano to determine whether a quote is the end or the start of a symmetrical multiline regex.  So, for every file opened, and probably also whenever a file is inserted into another, nano should run the precalc_multicolorinfo() routine.

Benno Schulenberg <bens>
Group administrator

 

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

Attached Files
file #35800:  precalc-each-file.patch added by bens (795B - text/x-diff)
file #35799:  prefer-local-match.patch added by bens (852B - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-01-14 bens Open/ClosedOpen Closed
    2015-12-20 bens StatusIn Progress Fixed
    2015-12-19 bens Attached File- Added precalc-each-file.patch, #35800
        Severity3 - Normal 2 - Minor
        StatusNone In Progress
        Assigned toNone bens
    2015-12-19 bens Attached File- Added prefer-local-match.patch, #35799

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code