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

 
 

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

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

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

Fixed in SVN, r5500.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

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
  • -unavailable- added by bens (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 14 Jan 2016 04:38:15 PM UTCbensOpen/ClosedOpen=>Closed
    Sun 20 Dec 2015 10:01:43 PM UTCbensStatusIn Progress=>Fixed
    Sat 19 Dec 2015 08:40:17 PM UTCbensAttached File-=>Added precalc-each-file.patch, #35800
      Severity3 - Normal=>2 - Minor
      StatusNone=>In Progress
      Assigned toNone=>bens
    Sat 19 Dec 2015 08:25:39 PM UTCbensAttached File-=>Added prefer-local-match.patch, #35799

    Back to the top


    Powered by Savane 3.1-cleanup1