patch 9.1.0965: filetype: sh filetype set when detecting the use of bash
Problem: filetype: sh filetype set when detecting the use of bash
Solution: when bash is detected, use 'bash' filetype instead
(Luca Saccarola)
closes: #16309
Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
0a3b9fb5c2
commit
b9b762c21f
1
runtime/autoload/dist/ft.vim
vendored
1
runtime/autoload/dist/ft.vim
vendored
@ -896,6 +896,7 @@ export def SetFileTypeSH(name: string, setft = true): string
|
|||||||
if exists("b:is_sh")
|
if exists("b:is_sh")
|
||||||
unlet b:is_sh
|
unlet b:is_sh
|
||||||
endif
|
endif
|
||||||
|
return SetFileTypeShell("bash", setft)
|
||||||
elseif name =~ '\<sh\>' || name =~ '\<dash\>'
|
elseif name =~ '\<sh\>' || name =~ '\<dash\>'
|
||||||
# Ubuntu links "sh" to "dash", thus it is expected to work the same way
|
# Ubuntu links "sh" to "dash", thus it is expected to work the same way
|
||||||
b:is_sh = 1
|
b:is_sh = 1
|
||||||
|
|||||||
@ -128,6 +128,10 @@ def s:GetFilenameChecks(): dict<list<string>>
|
|||||||
awk: ['file.awk', 'file.gawk'],
|
awk: ['file.awk', 'file.gawk'],
|
||||||
b: ['file.mch', 'file.ref', 'file.imp'],
|
b: ['file.mch', 'file.ref', 'file.imp'],
|
||||||
basic: ['file.bas', 'file.bi', 'file.bm'],
|
basic: ['file.bas', 'file.bi', 'file.bm'],
|
||||||
|
bash: ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout',
|
||||||
|
'.bash-logout', '.bash_aliases', '.bash-aliases', '.bash_history',
|
||||||
|
'.bash-history', '/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD',
|
||||||
|
'file.bash', 'file.bats', 'file.cygport'],
|
||||||
bass: ['file.bass'],
|
bass: ['file.bass'],
|
||||||
bc: ['file.bc'],
|
bc: ['file.bc'],
|
||||||
bdf: ['file.bdf'],
|
bdf: ['file.bdf'],
|
||||||
@ -685,11 +689,12 @@ def s:GetFilenameChecks(): dict<list<string>>
|
|||||||
services: ['/etc/services', 'any/etc/services'],
|
services: ['/etc/services', 'any/etc/services'],
|
||||||
setserial: ['/etc/serial.conf', 'any/etc/serial.conf'],
|
setserial: ['/etc/serial.conf', 'any/etc/serial.conf'],
|
||||||
sexplib: ['file.sexp'],
|
sexplib: ['file.sexp'],
|
||||||
sh: ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout', '.bash-logout', '.bash_aliases', '.bash-aliases', '.bash_history', '.bash-history',
|
sh: ['/usr/share/doc/bash-completion/filter.sh',
|
||||||
'/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD', 'file.bash', '/usr/share/doc/bash-completion/filter.sh',
|
'/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf',
|
||||||
'/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', 'file.bats', '.ash_history', 'any/etc/neofetch/config.conf', '.xprofile',
|
'.ash_history', 'any/etc/neofetch/config.conf', '.xprofile',
|
||||||
'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf', '.makepkg.conf', 'file.mdd', 'file.cygport', '.env', '.envrc', 'devscripts.conf',
|
'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf', '.makepkg.conf',
|
||||||
'.devscripts', 'file.lo', 'file.la', 'file.lai'],
|
'file.mdd', '.env', '.envrc', 'devscripts.conf', '.devscripts', 'file.lo',
|
||||||
|
'file.la', 'file.lai'],
|
||||||
sieve: ['file.siv', 'file.sieve'],
|
sieve: ['file.siv', 'file.sieve'],
|
||||||
sil: ['file.sil'],
|
sil: ['file.sil'],
|
||||||
simula: ['file.sim'],
|
simula: ['file.sim'],
|
||||||
@ -984,11 +989,11 @@ def s:GetScriptChecks(): dict<list<list<string>>>
|
|||||||
clojure: [['#!/path/clojure']],
|
clojure: [['#!/path/clojure']],
|
||||||
scala: [['#!/path/scala']],
|
scala: [['#!/path/scala']],
|
||||||
sh: [['#!/path/sh'],
|
sh: [['#!/path/sh'],
|
||||||
['#!/path/bash'],
|
|
||||||
['#!/path/bash2'],
|
|
||||||
['#!/path/dash'],
|
['#!/path/dash'],
|
||||||
['#!/path/ksh'],
|
['#!/path/ksh'],
|
||||||
['#!/path/ksh93']],
|
['#!/path/ksh93']],
|
||||||
|
bash: [['#!/path/bash'],
|
||||||
|
['#!/path/bash2']],
|
||||||
csh: [['#!/path/csh']],
|
csh: [['#!/path/csh']],
|
||||||
tcsh: [['#!/path/tcsh']],
|
tcsh: [['#!/path/tcsh']],
|
||||||
zsh: [['#!/path/zsh']],
|
zsh: [['#!/path/zsh']],
|
||||||
|
|||||||
@ -704,6 +704,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
965,
|
||||||
/**/
|
/**/
|
||||||
964,
|
964,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user