patch 9.1.0735: filetype: salt files are not recognized Commit: https://github.com/vim/vim/commit/89b9bb4ac8ceb701ebecb8c02aca3d047dff9991 Author: Gregory Anders <g...@gpanders.com> Date: Tue Sep 17 20:16:37 2024 +0200
patch 9.1.0735: filetype: salt files are not recognized Problem: filetype: salt files are not recognized Solution: Detect '*.sls' files as filetype salt, include a syntax script (Gregory Anders) closes: #15689 Signed-off-by: Gregory Anders <g...@gpanders.com> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS index b63735d01..bfce67884 100644 --- a/.github/MAINTAINERS +++ b/.github/MAINTAINERS @@ -551,6 +551,7 @@ runtime/syntax/rng.vim @jhradilek runtime/syntax/routeros.vim @zainin runtime/syntax/rst.vim @marshallward runtime/syntax/ruby.vim @dkearns +runtime/syntax/salt.vim @gpanders runtime/syntax/sass.vim @tpope runtime/syntax/scala.vim @derekwyatt runtime/syntax/scheme.vim @evhan diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 0f71bd74a..8f611893c 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -2231,6 +2231,9 @@ au BufNewFile,BufRead .zprofile,*/etc/zprofile,.zfbfmarks setf zsh au BufNewFile,BufRead .zshrc,.zshenv,.zlogin,.zlogout,.zcompdump,.zsh_history setf zsh au BufNewFile,BufRead *.zsh,*.zsh-theme,*.zunit setf zsh +" Salt state files +au BufNewFile,BufRead *.sls setf salt + " Scheme ("racket" patterns are now separate, see above) au BufNewFile,BufRead *.scm,*.ss,*.sld setf scheme diff --git a/runtime/syntax/salt.vim b/runtime/syntax/salt.vim new file mode 100644 index 000000000..fdbce2f67 --- /dev/null +++ b/runtime/syntax/salt.vim @@ -0,0 +1,16 @@ +" Vim syntax file +" Maintainer: Gregory Anders +" Last Changed: 2024-09-16 + +if exists('b:current_syntax') + finish +endif + +" Salt state files are just YAML with embedded Jinja +runtime! syntax/yaml.vim +unlet! b:current_syntax + +runtime! syntax/jinja.vim +unlet! b:current_syntax + +let b:current_syntax = 'salt' diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 938eec750..d1588f3f6 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -635,6 +635,7 @@ def s:GetFilenameChecks(): dict<list<string>> rtf: ['file.rtf'], ruby: ['.irbrc', 'irbrc', '.irb_history', 'irb_history', 'file.rb', 'file.rbw', 'file.gemspec', 'file.ru', 'Gemfile', 'file.builder', 'file.rxml', 'file.rjs', 'file.rant', 'file.rake', 'rakefile', 'Rakefile', 'rantfile', 'Rantfile', 'rakefile-file', 'Rakefile-file', 'Puppetfile', 'Vagrantfile'], rust: ['file.rs'], + salt: ['file.sls'], samba: ['smb.conf'], sas: ['file.sas'], sass: ['file.sass'], diff --git a/src/version.c b/src/version.c index 7558968a6..dbcb6eb45 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 735, /**/ 734, /**/ -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/E1sqcxh-005cws-Ox%40256bit.org.