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:
Luca Saccarola
2024-12-27 16:08:14 +01:00
committed by Christian Brabandt
parent 0a3b9fb5c2
commit b9b762c21f
3 changed files with 15 additions and 7 deletions

View File

@ -896,6 +896,7 @@ export def SetFileTypeSH(name: string, setft = true): string
if exists("b:is_sh")
unlet b:is_sh
endif
return SetFileTypeShell("bash", setft)
elseif name =~ '\<sh\>' || name =~ '\<dash\>'
# Ubuntu links "sh" to "dash", thus it is expected to work the same way
b:is_sh = 1