bugGNU nano - Bugs: bug #53716, when file type changes, the linter...

 
 

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

bug #53716: when file type changes, the linter or formatter is not changed when already used

Submitter:  Benno Schulenberg <bens>
Submitted:  Sun 22 Apr 2018 07:45:13 AM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Sun 22 Apr 2018 09:48:56 AM UTC, comment #1: 

Fixed in git, commit 1a4a3de6.

(The solution leaks some memory when linter or formatter or alternative speller is used multiple times during one session, but that is a smaller issue and of later concern.)

Benno Schulenberg <bens>
Group administrator
Sun 22 Apr 2018 07:45:13 AM UTC, original submission:  

To reproduce, add the following line to your sh.nanorc:

  formatter sed -i s/n/sh/

And add the following line to your python.nanorc:

  formatter sed -i s/n/PYPY/

Then create an example script, like so:

  echo -e "# Comment.\n./nonsense nonsense\n" >example.sh

Then run:

  nano example.sh

And type: ^T.  See how the first "n" in each line is replaced by "sh".  Good.  Now type: ^O <Backspace> <Backspace> py <Enter> Y.

See how the color of the comment changes to match the new syntax.  Then type ^T again.  Again an "n" is replaced by "sh", instead of by "PYPY" as the python formatter says.  Wrong.

(Problem was found after noticing that for the linter a copy of syntax->linter is passed to strtok() but for the formatter syntax->formatter itself is passed -- not both of them could be correct: either the first is superfluous or the latter is wrong.)

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

    Date Changed by Updated Field Previous Value => Replaced by
    2018-04-28 bens Open/ClosedOpen Closed
    2018-04-22 bens StatusNone Fixed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code