From 4ca6e08327496ed5efc3465c42464319302ba22a Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 13 Apr 2024 18:49:36 +0200 Subject: [PATCH] vim-patch:9.1.0318: filetype: translate shell config files are not recognized Problem: filetype: translate shell config files are not recognized Solution: Detect 'init.trans', 'translate-shell' and '.trans' files as clojure (Wu, Zhenyu) See: https://github.com/soimort/translate-shell/wiki/Configuration closes: vim/vim#14499 https://github.com/vim/vim/commit/4b5cd7257ee99384940d5210cf50298ff925924e Co-authored-by: Wu, Zhenyu --- runtime/lua/vim/filetype.lua | 3 +++ test/old/testdir/test_filetype.vim | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 0e06cf69e6..d23f4147e9 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -1295,6 +1295,8 @@ local filename = { ['/etc/defaults/cdrdao'] = 'cdrdaoconf', ['cfengine.conf'] = 'cfengine', cgdbrc = 'cgdbrc', + ['init.trans'] = 'clojure', + ['.trans'] = 'clojure', ['CMakeLists.txt'] = 'cmake', ['.cling_history'] = 'cpp', ['.alias'] = detect.csh, @@ -1738,6 +1740,7 @@ local pattern = { }, ['[cC]hange[lL]og.*'] = starsetf(detect.changelog), ['.*%.%.ch'] = 'chill', + ['.*/etc/translate%-shell'] = 'clojure', ['.*%.cmake%.in'] = 'cmake', -- */cmus/rc and */.cmus/rc ['.*/%.?cmus/rc'] = 'cmusrc', diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim index 6ef011bf09..734559ffda 100644 --- a/test/old/testdir/test_filetype.vim +++ b/test/old/testdir/test_filetype.vim @@ -156,7 +156,7 @@ func s:GetFilenameChecks() abort \ 'chuck': ['file.ck'], \ 'cl': ['file.eni'], \ 'clean': ['file.dcl', 'file.icl'], - \ 'clojure': ['file.clj', 'file.cljs', 'file.cljx', 'file.cljc'], + \ 'clojure': ['file.clj', 'file.cljs', 'file.cljx', 'file.cljc', 'init.trans', 'any/etc/translate-shell', '.trans'], \ 'cmake': ['CMakeLists.txt', 'file.cmake', 'file.cmake.in'], \ 'cmod': ['file.cmod'], \ 'cmusrc': ['any/.cmus/autosave', 'any/.cmus/rc', 'any/.cmus/command-history', 'any/.cmus/file.theme', 'any/cmus/rc', 'any/cmus/file.theme', '/.cmus/autosave', '/.cmus/command-history', '/.cmus/file.theme', '/.cmus/rc', '/cmus/file.theme', '/cmus/rc'],