bugGNU nano - Bugs: bug #53970, the linter sometimes asks to open...

 
 

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

bug #53970: the linter sometimes asks to open an already open buffer

Submitter:  None
Submitted:  Thu 24 May 2018 01:21:21 PM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Thu 24 May 2018 05:47:19 PM UTC, comment #2: 

Fixed in git, commit 73d397c6.

Benno Schulenberg <bens>
Group administrator
Thu 24 May 2018 03:16:59 PM UTC, comment #1: 

Ooof!  It just checks one other buffer, the next door one, and then gives up.  :|  This goes to show that the linter isn't actually getting used, otherwise soemone would have reported this long ago -- I imagine.

Anyway, thanks for the report and the fix.  (Looking into ways how to make the program flow smoother before pushing it.)

Benno Schulenberg <bens>
Group administrator
Thu 24 May 2018 01:21:21 PM UTC, original submission:  

How to reproduce it:
 - Add the following line to the end of you .nanorc:

  extendsyntax c linter echo src/nano.c:1: test

 - Run nano with

  nano src/*.[ch]

 - Hit ^T

What happens:
 - Nano asks to open src/nano.c even though it is already open.

What should happen:
 - Nano should switch to the buffer where src/nano.c is already open.

What causes the bug to happen:
 - In src/text.c:3268 there is the assignment

  openfilestruct *tmpof = openfile;

 - Some lines after that, there is the while loop which checks if a file is already open. The condition for the loop is: tmpof != openfile->next and the iteration step is tmpof = tmpof->next; . So it does not iterate through all open buffers.

How to fix the bug:
 - Attached patch fixes it by changing the way the loop done.

Anonymous

 

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

Attached Files
file #44210:  fix_checking_open_buffer.patch added by None (904B - text/x-patch - Patch to fix the bug to check all open buffer when linter need to open a new file)

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2018-06-02 bens Open/ClosedOpen Closed
    2018-05-24 bens StatusIn Progress Fixed
    2018-05-24 bens StatusNone In Progress
        Assigned toNone bens
        SummaryLinter asks to open an already open buffer the linter sometimes asks to open an already open buffer
    2018-05-24 None Attached File- Added fix_checking_open_buffer.patch, #44210

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code