mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-25 06:09:38 +03:00
syntax: makefile, sh: recognize also a fresh Makefile and fresh .profile
When opening a nonexistent file with nano, it likely consists of only a name without any path component, and thus without any slash. So when a file regex checks for a slash, it should check also for start-of-string. This fixes https://savannah.gnu.org/bugs/?65591. Problem existed for the Makefile since version 2.9.8, commit22663f8a
, and for .profile since version 3.0, commit4a268678
(but earlier, nano did not recognize .profile files at all).
This commit is contained in:
parent
c695d49a86
commit
c02aec557c
@ -1,6 +1,6 @@
|
||||
## Syntax highlighting for Makefiles.
|
||||
|
||||
syntax makefile "(/((GNU)?m|M)akefile[^/]*$|\.(make|mk)$)"
|
||||
syntax makefile "(^|/)((GNU)?m|M)akefile[^/]*$|\.(make|mk)$"
|
||||
magic "makefile script"
|
||||
|
||||
tabgives " "
|
||||
|
@ -1,6 +1,6 @@
|
||||
## Syntax highlighting for Bourne shell scripts.
|
||||
|
||||
syntax sh "(\.sh|(\.|/)(a|ba|c|da|k|mk|pdk|tc|z)sh(rc|_profile)?|/(etc/|\.)profile)$"
|
||||
syntax sh "(\.sh|(^|/|\.)(a|ba|c|da|k|mk|pdk|tc|z)sh(rc|_profile)?|(/etc/|(^|/)\.)profile)$"
|
||||
header "^#!.*/((env[[:blank:]]+)?((a|ba|c|da|k|mk|pdk|tc|z)?sh)|busybox[[:blank:]]+sh|openrc-run|runscript)\>"
|
||||
header "-\*-.*shell-script.*-\*-"
|
||||
magic "(POSIX|Bourne-Again) shell script.*text"
|
||||
|
Loading…
Reference in New Issue
Block a user