]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0735: filetype: salt files are not recognized v9.1.0735
authorGregory Anders <greg@gpanders.com>
Tue, 17 Sep 2024 18:16:37 +0000 (20:16 +0200)
committerChristian Brabandt <cb@256bit.org>
Tue, 17 Sep 2024 18:16:37 +0000 (20:16 +0200)
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 <greg@gpanders.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
.github/MAINTAINERS
runtime/filetype.vim
runtime/syntax/salt.vim [new file with mode: 0644]
src/testdir/test_filetype.vim
src/version.c

index b63735d019377e66ff10136e36d8f1cb3e951008..bfce67884206eb56cce04322a7d5c32ce89e1a34 100644 (file)
@@ -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
index 0f71bd74aee0e6677585944d0774d2c090556167..8f611893c6fc5fb00e85ff44a02b854f33781b2e 100644 (file)
@@ -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 (file)
index 0000000..fdbce2f
--- /dev/null
@@ -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'
index 938eec750e7038222f2f124ce4c49e06c4cf096c..d1588f3f68f68bdb6181a88ee04dbf6ac6f7892b 100644 (file)
@@ -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'],
index 7558968a6d2d22b08a7cb701e1f91a666685f83e..dbcb6eb45b09125ddee31bddae9881d6a28e3e55 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    735,
 /**/
     734,
 /**/