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

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Sun 22 Apr 2018 07:45:13 AM UTC  
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  Benno Schulenberg <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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.

 

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)
  •  

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

    Only logged-in users can vote.

     

     

     

    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.7