Skip to content

Commit 727c567

Browse files
committed
patch 9.1.1030: filetype: setting bash filetype is backwards incompatible
Problem: filetype: setting bash filetype is backwards incompatible Solution: revert patch v9.1.0965, detect bash scripts again as sh filetype This reverts commit b9b762c. related: #16309 Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent c2a967a commit 727c567

4 files changed

Lines changed: 10 additions & 17 deletions

File tree

runtime/autoload/dist/ft.vim

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,6 @@ export def SetFileTypeSH(name: string, setft = true): string
900900
if exists("b:is_sh")
901901
unlet b:is_sh
902902
endif
903-
return SetFileTypeShell("bash", setft)
904903
elseif name =~ '\<sh\>' || name =~ '\<dash\>'
905904
# Ubuntu links "sh" to "dash", thus it is expected to work the same way
906905
b:is_sh = 1

runtime/doc/version9.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*version9.txt* For Vim version 9.1. Last change: 2025 Jan 16
1+
*version9.txt* For Vim version 9.1. Last change: 2025 Jan 18
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -41617,8 +41617,6 @@ Changed~
4161741617
|CompleteDone| autocommand in the |v:event| dictionary
4161841618
- the default fontsize for the GTK builds of Vim (Windows and Unix) has been
4161941619
increased to 12pt to accomodate modern high-dpi monitors
41620-
- filetype detection now detects bash scripts as a separate "bash" filetype
41621-
instead of the "sh" filetype
4162241620
- the default value of the 'keyprotocol' option has been updated by support
4162341621
for the ghostty terminal emulator (using kitty protocol)
4162441622
- |complete_info()| returns the list of matches shown in the poppu menu via

src/testdir/test_filetype.vim

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,6 @@ def s:GetFilenameChecks(): dict<list<string>>
127127
ave: ['file.ave'],
128128
awk: ['file.awk', 'file.gawk'],
129129
b: ['file.mch', 'file.ref', 'file.imp'],
130-
bash: ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout',
131-
'.bash-logout', '.bash_aliases', '.bash-aliases', '.bash_history',
132-
'.bash-history', '/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD',
133-
'file.bash', 'file.bats', 'file.cygport'],
134130
basic: ['file.bas', 'file.bi', 'file.bm'],
135131
bass: ['file.bass'],
136132
bc: ['file.bc'],
@@ -690,13 +686,11 @@ def s:GetFilenameChecks(): dict<list<string>>
690686
services: ['/etc/services', 'any/etc/services'],
691687
setserial: ['/etc/serial.conf', 'any/etc/serial.conf'],
692688
sexplib: ['file.sexp'],
693-
sh: ['/usr/share/doc/bash-completion/filter.sh',
694-
'/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf',
695-
'.ash_history', 'any/etc/neofetch/config.conf', '.xprofile',
696-
'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf', '.makepkg.conf',
697-
'file.mdd', '.env', '.envrc', 'devscripts.conf', '.devscripts', 'file.lo',
698-
'file.la', 'file.lai'],
699-
shaderslang: ['file.slang'],
689+
sh: ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout', '.bash-logout', '.bash_aliases', '.bash-aliases', '.bash_history', '.bash-history',
690+
'/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD', 'file.bash', '/usr/share/doc/bash-completion/filter.sh',
691+
'/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', 'file.bats', '.ash_history', 'any/etc/neofetch/config.conf', '.xprofile',
692+
'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf', '.makepkg.conf', 'file.mdd', 'file.cygport', '.env', '.envrc', 'devscripts.conf',
693+
'.devscripts', 'file.lo', 'file.la', 'file.lai'],
700694
sieve: ['file.siv', 'file.sieve'],
701695
sil: ['file.sil'],
702696
simula: ['file.sim'],
@@ -988,11 +982,11 @@ def s:GetScriptChecks(): dict<list<list<string>>>
988982
clojure: [['#!/path/clojure']],
989983
scala: [['#!/path/scala']],
990984
sh: [['#!/path/sh'],
985+
['#!/path/bash'],
986+
['#!/path/bash2'],
991987
['#!/path/dash'],
992988
['#!/path/ksh'],
993989
['#!/path/ksh93']],
994-
bash: [['#!/path/bash'],
995-
['#!/path/bash2']],
996990
csh: [['#!/path/csh']],
997991
tcsh: [['#!/path/tcsh']],
998992
zsh: [['#!/path/zsh']],

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
1030,
707709
/**/
708710
1029,
709711
/**/

0 commit comments

Comments
 (0)