]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0769: filetype: MLIR files are not recognized v9.1.0769
authorWu, Zhenyu <wuzhenyu@ustc.edu>
Tue, 8 Oct 2024 19:58:35 +0000 (21:58 +0200)
committerChristian Brabandt <cb@256bit.org>
Tue, 8 Oct 2024 19:58:35 +0000 (21:58 +0200)
Problem:  filetype: MLIR files are not recognized
Solution: Detect '*.mlir' files as mlir filetype,
          include a mlir filetype plugin
          (Wu, Zhenyu)

closes: #15826

Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/filetype.vim
runtime/ftplugin/mlir.vim [new file with mode: 0644]
src/testdir/test_filetype.vim
src/version.c

index 7f396252167d478524136310a66b2f88b1599aec..4b5577acb867808478aef104ebc12a8f144f06bb 100644 (file)
@@ -576,6 +576,9 @@ au BufNewFile,BufRead lynx.cfg                      setf lynx
 " LyRiCs
 au BufNewFile,BufRead *.lrc                    setf lyrics
 
+" MLIR
+au BufNewFile,BufRead *.mlir                   setf mlir
+
 " Modula-3 configuration language (must be before *.cfg and *makefile)
 au BufNewFile,BufRead *.quake,cm3.cfg          setf m3quake
 au BufNewFile,BufRead m3makefile,m3overrides   setf m3build
diff --git a/runtime/ftplugin/mlir.vim b/runtime/ftplugin/mlir.vim
new file mode 100644 (file)
index 0000000..c6a9dc3
--- /dev/null
@@ -0,0 +1,10 @@
+" Vim filetype plugin file
+" Language:    MLIR
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+setl comments=:///,://
+setl commentstring=//\ %s
+
+let b:undo_ftplugin = "setl commentstring< comments<"
index a780002ba41f92de688e0138a2569b06422daf22..bd79fbb78275e27cf1feb005367e8c76d741c9c3 100644 (file)
@@ -479,6 +479,7 @@ def s:GetFilenameChecks(): dict<list<string>>
     mgp: ['file.mgp'],
     mib: ['file.mib', 'file.my'],
     mix: ['file.mix', 'file.mixal'],
+    mlir: ['file.mlir'],
     mma: ['file.nb', 'file.wl'],
     mmp: ['file.mmp'],
     modconf: ['/etc/modules.conf', '/etc/modules', '/etc/conf.modules', '/etc/modprobe.file', 'any/etc/conf.modules', 'any/etc/modprobe.file', 'any/etc/modules', 'any/etc/modules.conf'],
index bff689e65303b7a241bc1c56a670c99ab0c7a515..b87fc7870535091402db7db44e1c1a4b0388adab 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    769,
 /**/
     768,
 /**/