bugGNU nano - Bugs: bug #53699, [Request] parse first line of doc...

 
 

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

bug #53699: [Request] parse first line of doc to determine syntax, in addition to .extension

Submitter:  Rob Munsch <robmunsch>
Submitted:  Thu 19 Apr 2018 04:45:38 PM UTC
   
 
Severity:  1 - Wish Status:  Works For Me
Assigned to:  None Open/Closed:  Closed

Mon 23 Apr 2018 05:29:57 PM UTC, comment #4: 

(It seems that Macos X has 2.0.6 installed by default, so probably you are on Red Hat 6.9 or CentOS 6.9 -- but I'm perplexed that these fairly recent releases ship with such an ancient version of nano.)

Benno Schulenberg <bens>
Group administrator
Thu 19 Apr 2018 07:17:11 PM UTC, comment #3: 

If you're on 2.0.9, then you're on a Mac?  Or on an old Debian?  If the former, you want to look into Homebrew (https://brew.sh/).

I didn't think it would understand things with "!/bin/env", but... I've tested it, and it works!  Don't ask me how.  :)

Benno Schulenberg <bens>
Group administrator
Thu 19 Apr 2018 06:04:23 PM UTC, comment #2: 

Ah. Well then.

It seems we have nano 2.0.9 installed, and it's entirely possible I've simply never been somewhere with a recent version. How embarassing.

Curious side note: does it handle things like #!/bin/env bash as well as direct references?

Rob Munsch <robmunsch>
Thu 19 Apr 2018 05:53:43 PM UTC, comment #1: 

Nano already scans the first line of the file if the extension gives no clue.  This detection is present since I-don't-know-when, but should be working since at least 2.6.1.

If you are using a recent version of nano and this header-line detection is not working for you, can you show an example script file where it fails for you?

Benno Schulenberg <bens>
Group administrator
Thu 19 Apr 2018 04:45:38 PM UTC, original submission:  

I'm always running into places and scripts that insist on not having any sort of file extension which, while I admit keeps *bin dirs looking clean, is annoying when editing them.

Workaround, of course, is to have my local copy with the .sh or whatnot and copy it back without, but this becomes slightly more annoying when using a repository.

Hardly a huge problem, but I have no idea if it might be simple to add or not.

Rob Munsch <robmunsch>

 

(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 (Posted a comment)
  • -email is unavailable- added by robmunsch (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-04-24 bens Open/ClosedOpen Closed
    2018-04-21 bens Severity3 - Normal 1 - Wish
    2018-04-21 bens Summary[Request] Parse first line of doc for syntax highlighting in addition to .extension, e.g. shebang for scripts [Request] parse first line of doc to determine syntax, in addition to .extension
    2018-04-19 bens StatusNone Works For Me
        Summary[Request] Parse first line of doc for syntax highlighting in addition to .extension e.g. shebang for scripts [Request] Parse first line of doc for syntax highlighting in addition to .extension, e.g. shebang for scripts

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code