bugGNU nano - Bugs: bug #60072, with the c syntax, there are too...

 
 

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

bug #60072: with the c syntax, there are too many unneeded redraws

Submitter:  Benno Schulenberg <bens>
Submitted:  Wed 17 Feb 2021 04:04:30 PM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Thu 18 Feb 2021 11:25:51 AM UTC, comment #2: 

Fixed in git, commit b94dcfd3, by reducing the rule for NOTHING to refer to just a start match, and by addding a rule for WOULDBE (the same as the one for WHOLELINE).

And closing because this isn't really a bug: there was no observable wrong behavior.  It was just a matter of inefficiency, of unneeded redraws.

Benno Schulenberg <bens>
Group administrator
Thu 18 Feb 2021 11:03:46 AM UTC, comment #1: 

The issue is that check_the_multis() doesn't do the right thing for lines that are marked as NOTHING.  For such lines it doesn't matter whether the is an end match on that line, because the NOTHING means that there isn't an unpaired start match on or before this line, so the existence or the appearance of an end match would not cause anything to be colored differently, so there is no need for a refresh.

Additionally, when a line is currently marked as WOULDBE, any edit on such a line would trigger a refresh, but only edits that make an end match appear should trigger this.  The existence or the appearance of a start match is irrelevant, it would not cause any color changes.  However, since start and end regexes could match the same things, and it is thus possible that an end match is mistakenly interpreted as a start match, it is necessary for WOULDBE lines to check that it contains neither start nor end match.  This still leads to unneeded refreshes while editing the line that contains the unpaired start match, but at least editing later lines will not cause any unneeded refreshes.

Benno Schulenberg <bens>
Group administrator
Wed 17 Feb 2021 04:04:30 PM UTC, original submission:  

To reproduce, uncomment the #define TIMEREFRESH line in src/winio.c, compile, and the run:

src/nano --quick +755 src/text.c

Type a few characters, type <Bsp> and <Del> a few times.  See that for every keystroke the Refresh time is shown in the status bar, meaning that the full edit window has been redrawn.  Now move the cursor around a bit with the arrow keys.  See that no redraws occur.  Now use <Alt+Up>/<Alt+Down> a few times.  See that no full redraw occurs -- nano just tells ncurses to scroll and then draws the missing line.

Expected behavior: when editing within a single line, no full redraw of the screen should be needed (unless the multidata no longer matches the curren situation).

The redraw is triggered by the coloring rule for the preprocessor directives in the c syntax: it's end regex matches practically every line, but almost no lines are actually marked as ENDSHERE.

(Original report was made in comment number 2 of bug #60041.)

Benno Schulenberg <bens>
Group administrator

 

(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 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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-02-18 bens StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2021-02-18 bens StatusNone In Progress
        Assigned toNone bens

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code