nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit c524fbe6d058a488520f306ef2e614a11a6d3780
parent 93c8e316a8f4d7b507c3c016506dccee014846b5
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Tue, 28 Aug 2018 19:47:40 +0200

tweaks: remove some ineffectual parts from header-line regexes

Adding "[abc]*" does not restrict the recognized header line in any way.

Also, improve the header-line regex for shell scripts, because it should
not match "barunscript" (for example).

Diffstat:
Msyntax/perl.nanorc | 2+-
Msyntax/python.nanorc | 2+-
Msyntax/ruby.nanorc | 2+-
Msyntax/sh.nanorc | 2+-
4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/syntax/perl.nanorc b/syntax/perl.nanorc @@ -1,7 +1,7 @@ ## Here is an example for Perl. syntax perl "\.p[lm]$" -header "^#!.*perl[-0-9._]*" +header "^#!.*perl" magic "Perl script" comment "#" diff --git a/syntax/python.nanorc b/syntax/python.nanorc @@ -1,7 +1,7 @@ ## Here is an example for Python. syntax python "\.py$" -header "^#!.*python[-0-9._]*" +header "^#!.*python" magic "Python script" linter pyflakes comment "#" diff --git a/syntax/ruby.nanorc b/syntax/ruby.nanorc @@ -1,7 +1,7 @@ ## Here is an example for Ruby. syntax ruby "\.rb$" -header "^#!.*ruby[-0-9._]*" +header "^#!.*ruby" magic "Ruby script" linter ruby -w -c comment "#" diff --git a/syntax/sh.nanorc b/syntax/sh.nanorc @@ -1,7 +1,7 @@ ## Here is an example for Bourne shell scripts. syntax sh "(\.sh|\.(a|ba|c|da|k|mk|pdk|tc|z)(sh|shrc|sh_profile)|/(etc/|\.)profile)$" -header "^#!.*(a|ba|c|da|k|mk|pdk|tc|z)?(sh[-0-9_]*|openrc-run|runscript)" +header "^#!.*/(((a|ba|c|da|k|mk|pdk|tc|z)?sh)|openrc-run|runscript)" magic "(POSIX|Bourne-Again) shell script.*text" linter dash -n comment "#"