]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1177: filetype: tera files not detected v9.1.1177
authorMuntasirSZN <muntasir.joypurhat@gmail.com>
Thu, 6 Mar 2025 20:06:38 +0000 (21:06 +0100)
committerChristian Brabandt <cb@256bit.org>
Thu, 6 Mar 2025 20:06:38 +0000 (21:06 +0100)
Problem:  filetype: tera files not detected
Solution: detect '*.tera' files as tera filetype,
          include a simple filetype plugin
          (MuntasirSZN)

closes: #16806

Signed-off-by: MuntasirSZN <muntasir.joypurhat@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
.github/MAINTAINERS
runtime/filetype.vim
runtime/ftplugin/tera.vim [new file with mode: 0644]
src/testdir/test_filetype.vim
src/version.c

index 071553b9fe4a89a9323fa1780d233fde5178c2c8..a71f01b292341570d8a8bef303fdd7c0edfe947b 100644 (file)
@@ -295,6 +295,7 @@ runtime/ftplugin/systemverilog.vim  @Kocha
 runtime/ftplugin/swig.vim              @jmarrec
 runtime/ftplugin/tap.vim               @petdance
 runtime/ftplugin/tcsh.vim              @dkearns
+runtime/ftplugin/tera.vim              @MuntasirSZN
 runtime/ftplugin/terraform.vim         @JannoTjarks
 runtime/ftplugin/tf.vim                        @ribru17
 runtime/ftplugin/thrift.vim            @jiangyinzuo
index 50c9f08f7c73813ec60e6b7428f9c424b7271913..8b4091ae7911a5c79cf66a70a7552c08dd339968 100644 (file)
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:  The Vim Project <https://github.com/vim/vim>
-" Last Change: 2025 Mar 05
+" Last Change: 2025 Mar 06
 " Former Maintainer:   Bram Moolenaar <Bram@vim.org>
 
 " Listen very carefully, I will say this only once
@@ -2604,6 +2604,9 @@ au BufRead,BufNewFile *.ttl
 " Terminfo
 au BufNewFile,BufRead *.ti                     setf terminfo
 
+" Tera
+au BufRead,BufNewFile *.tera                   setf tera
+
 " Terraform variables
 au BufRead,BufNewFile *.tfvars                 setf terraform-vars
 
diff --git a/runtime/ftplugin/tera.vim b/runtime/ftplugin/tera.vim
new file mode 100644 (file)
index 0000000..47636f2
--- /dev/null
@@ -0,0 +1,13 @@
+" Vim filetype plugin file
+" Language:             Tera
+" Maintainer:           Muntasir Mahmud <muntasir.joypurhat@gmail.com>
+" Last Change:          2025 Mar 06
+
+if exists("b:did_ftplugin")
+  finish
+endif
+let b:did_ftplugin = 1
+
+setlocal commentstring={#\ %s\ #}
+
+let b:undo_ftplugin = "setlocal commentstring<"
index d8fc0a1e008774f946e6137673b6d81c17bf4495..b6beb3f5d39de74ed0007cd209775d0dd2d037c8 100644 (file)
@@ -804,6 +804,7 @@ def s:GetFilenameChecks(): dict<list<string>>
     teal: ['file.tl'],
     templ: ['file.templ'],
     template: ['file.tmpl'],
+    tera: ['file.tera'],
     teraterm: ['file.ttl'],
     terminfo: ['file.ti'],
     'terraform-vars': ['file.tfvars'],
index 65c716929b3c81cef2d067d0896a37e0e94ee3d1..790fc7d0dac493892fdb3e2c55968613368192e1 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1177,
 /**/
     1176,
 /**/