diff options
author | Christian Clason <c.clason@uni-graz.at> | 2025-01-18 10:42:11 +0100 |
---|---|---|
committer | Christian Clason <ch.clason+github@icloud.com> | 2025-01-20 08:20:36 +0100 |
commit | 5b025b499ec430f1733409f0fb5ba3f88ce25a88 (patch) | |
tree | 57ea4a7a59f7ad52f62b6b0da853a9dfa7a97d96 | |
parent | b172dd57faac8de98291b644c0b0e1ee6d4691e0 (diff) | |
download | rneovim-5b025b499ec430f1733409f0fb5ba3f88ce25a88.tar.gz rneovim-5b025b499ec430f1733409f0fb5ba3f88ce25a88.tar.bz2 rneovim-5b025b499ec430f1733409f0fb5ba3f88ce25a88.zip |
vim-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 b9b762c21f2b61e0e7d8fee43d4d3dc8ecffd721.
related: vim/vim#16309
https://github.com/vim/vim/commit/727c567a0934643e2d6e1dd92d4e636b17d9067f
Co-authored-by: Christian Brabandt <cb@256bit.org>
vim-patch:9.1.1033: tests: shaderslang was removed from test_filetype erroneously
Problem: tests: shaderslang was removed from test_filetype erroneously
(Christian Clason, after v9.1.1030)
Solution: restore the test
https://github.com/vim/vim/commit/1d2867df0c5dfa3d2444229f9e4b23d6ff935956
Co-authored-by: Christian Brabandt <cb@256bit.org>
-rw-r--r-- | runtime/lua/vim/filetype/detect.lua | 1 | ||||
-rw-r--r-- | test/functional/lua/filetype_spec.lua | 2 | ||||
-rw-r--r-- | test/old/testdir/test_filetype.vim | 16 |
3 files changed, 8 insertions, 11 deletions
diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua index 30a9951f6a..31c88c80bd 100644 --- a/runtime/lua/vim/filetype/detect.lua +++ b/runtime/lua/vim/filetype/detect.lua @@ -1527,7 +1527,6 @@ local function sh(path, contents, name) vim.b[b].is_kornshell = nil vim.b[b].is_sh = nil end - return M.shell(path, contents, 'bash'), on_detect -- Ubuntu links sh to dash elseif matchregex(name, [[\<\(sh\|dash\)\>]]) then on_detect = function(b) diff --git a/test/functional/lua/filetype_spec.lua b/test/functional/lua/filetype_spec.lua index d64c024d7f..b75ff75b05 100644 --- a/test/functional/lua/filetype_spec.lua +++ b/test/functional/lua/filetype_spec.lua @@ -119,7 +119,7 @@ describe('vim.filetype', function() it('works with contents #22180', function() eq( - 'bash', + 'sh', exec_lua(function() -- Needs to be set so detect#sh doesn't fail vim.g.ft_ignore_pat = '\\.\\(Z\\|gz\\|bz2\\|zip\\|tgz\\)$' diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim index 7213f3b032..020603015f 100644 --- a/test/old/testdir/test_filetype.vim +++ b/test/old/testdir/test_filetype.vim @@ -128,9 +128,6 @@ func s:GetFilenameChecks() abort \ 'ave': ['file.ave'], \ 'awk': ['file.awk', 'file.gawk'], \ 'b': ['file.mch', 'file.ref', 'file.imp'], - \ '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'], \ 'basic': ['file.bas', 'file.bi', 'file.bm'], \ 'bass': ['file.bass'], \ 'bc': ['file.bc'], @@ -686,10 +683,11 @@ func s:GetFilenameChecks() abort \ 'services': ['/etc/services', 'any/etc/services'], \ 'setserial': ['/etc/serial.conf', 'any/etc/serial.conf'], \ 'sexplib': ['file.sexp'], - \ 'sh': ['/usr/share/doc/bash-completion/filter.sh', '/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', - \ '.ash_history', 'any/etc/neofetch/config.conf', '.xprofile', 'user-dirs.defaults', 'user-dirs.dirs', - \ 'makepkg.conf', '.makepkg.conf', 'file.mdd', '.env', '.envrc', 'devscripts.conf', '.devscripts', 'file.lo', - \ 'file.la', 'file.lai'], + \ 'sh': ['.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', '/usr/share/doc/bash-completion/filter.sh', + \ '/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', 'file.bats', '.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', + \ '.devscripts', 'file.lo', 'file.la', 'file.lai'], \ 'shaderslang': ['file.slang'], \ 'sieve': ['file.siv', 'file.sieve'], \ 'sil': ['file.sil'], @@ -981,11 +979,11 @@ func s:GetScriptChecks() abort \ 'clojure': [['#!/path/clojure']], \ 'scala': [['#!/path/scala']], \ 'sh': [['#!/path/sh'], + \ ['#!/path/bash'], + \ ['#!/path/bash2'], \ ['#!/path/dash'], \ ['#!/path/ksh'], \ ['#!/path/ksh93']], - \ 'bash': [['#!/path/bash'], - \ ['#!/path/bash2']], \ 'csh': [['#!/path/csh']], \ 'tcsh': [['#!/path/tcsh']], \ 'zsh': [['#!/path/zsh']], |