bugGNU nano - Bugs: bug #53977, linter does not update margin when...

 
 

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

bug #53977: linter does not update margin when switching to a much larger buffer

Submitter:  None
Submitted:  Fri 25 May 2018 12:50:13 AM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Fri 25 May 2018 04:04:33 PM UTC, comment #3: 

So, I've opted to check the margin also just in the linter.

Fixed in git, commit 86c08560.  Thanks for the report.

Benno Schulenberg <bens>
Group administrator
Fri 25 May 2018 03:55:14 PM UTC, comment #2: 

It results that the crash from comment #1 is unrelated to the original report.  This crash has been rereported as bug #53981.

Returning this bug report to what it was: the margin being sometimes too small, because it gets updated only in the centra loop, not in the linter.

Updating the margin in edit_refresh() is not a good idea, though.  First, because edit-refresh() gets called in at least twelve different places, and in most of those places it is impossible for the margin to have changed, so checking that would be a waste of time.  And second, in the central loop, often edit_refresh() gets called, which would mean that update_margin() would be called twice.

Benno Schulenberg <bens>
Group administrator
Fri 25 May 2018 08:09:03 AM UTC, comment #1: 

It's even worse.  With your settings, run for example:

  nano  new.c  src/winio.c

where new.c is a new file.  Type ^T.  Result: "Sorry! Nano crashed!"

Benno Schulenberg <bens>
Group administrator
Fri 25 May 2018 12:50:13 AM UTC, original submission:  

How to reproduce the bug:
 - Add the following lines to the end of your .nanorc:
  set linenumbers
  extendsyntax c linter echo src/winio.c:1000: test

 - Run nano compiled from source with the following command line:
  ./src/nano ./src/color.c ./src/winio.c

 - Hit ^T

What happens:
 - There's no left margin between line numbers and buffer contents.

What should happen:
 - There should be a left margin between line numbers and buffer contents.

What causes the bug:
 - Global variable is not updated after a edit_refresh is called. The previous margin is kept and, since it is based on a buffer with 10x fewer lines, the margin is smaller the it should.

How to fix the bug:
 - Guarantee that margin is also updated when edit_refresh is called. See attached patch.

Anonymous

 

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

Attached Files
file #44214:  0001-Update-margin-size-when-edit_refresh-is-called.patch added by None (3KiB - text/x-patch - Update margin size on edit refresh)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  •  

    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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-06-02 bens Open/ClosedOpen Closed
    2018-05-25 bens StatusIn Progress Fixed
        Summarylinter does not update margin when switching to a much larger buffe linter does not update margin when switching to a much larger buffer
    2018-05-25 bens Severity4 - Important 3 - Normal
        StatusNone In Progress
        Summarynano can crash in linter when buffers differ greatly in size linter does not update margin when switching to a much larger buffe
    2018-05-25 bens Severity3 - Normal 4 - Important
        Assigned toNone bens
        SummaryLinter leaves no left margin when switching to a buffer 10x the number of lines nano can crash in linter when buffers differ greatly in size
    2018-05-25 None Attached File- Added 0001-Update-margin-size-when-edit_refresh-is-called.patch, #44214

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code