Skip to content

Commit b73ccf7

Browse files
patch 9.1.1829: filetype: KerML and SysML files are not recognized
Problem: filetype: KerML and SysML files are not recognized Solution: Detect *.kerml as kerml filetype, detect *.sysml as sysml filetype, include a kerml and sysml filetype plugin (Daumantas Kavolis) closes: #18476 Signed-off-by: Daumantas Kavolis <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 6858587 commit b73ccf7

File tree

6 files changed

+48
-1
lines changed

6 files changed

+48
-1
lines changed

.github/MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ runtime/ftplugin/julia.vim @carlobaldassi
214214
runtime/ftplugin/just.vim @pbnj
215215
runtime/ftplugin/kconfig.vim @chrisbra
216216
runtime/ftplugin/kdl.vim @imsnif @jiangyinzuo
217+
runtime/ftplugin/kerml.vim @daumantas-kavolis-sensmetry
217218
runtime/ftplugin/kivy.vim @ribru17
218219
runtime/ftplugin/kotlin.vim @udalov
219220
runtime/ftplugin/lc.vim @ribru17
@@ -296,6 +297,7 @@ runtime/ftplugin/sshdconfig.vim @jiangyinzuo
296297
runtime/ftplugin/svelte.vim @igorlfs
297298
runtime/ftplugin/sway.vim @ribru17
298299
runtime/ftplugin/swayconfig.vim @jamespeapen
300+
runtime/ftplugin/sysml.vim @daumantas-kavolis-sensmetry
299301
runtime/ftplugin/systemverilog.vim @Kocha
300302
runtime/ftplugin/swig.vim @jmarrec
301303
runtime/ftplugin/tap.vim @petdance

runtime/filetype.vim

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Vim support file to detect file types
22
"
33
" Maintainer: The Vim Project <https://github.com/vim/vim>
4-
" Last Change: 2025 Oct 03
4+
" Last Change: 2025 Oct 05
55
" Former Maintainer: Bram Moolenaar <[email protected]>
66

77
" Listen very carefully, I will say this only once
@@ -1359,6 +1359,9 @@ endif
13591359
" KDL
13601360
au BufNewFile,BufRead *.kdl setf kdl
13611361

1362+
" KerML
1363+
au BufNewFile,BufRead *.kerml setf kerml
1364+
13621365
" Kixtart
13631366
au BufNewFile,BufRead *.kix setf kix
13641367

@@ -2627,6 +2630,9 @@ au BufNewFile,BufRead *.svg setf svg
26272630
" Surface
26282631
au BufRead,BufNewFile *.sface setf surface
26292632

2633+
" SysML
2634+
au BufNewFile,BufReadPost *.sysml setf sysml
2635+
26302636
" LLVM TableGen
26312637
au BufNewFile,BufRead *.td setf tablegen
26322638

runtime/ftplugin/kerml.vim

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
" Vim filetype plugin
2+
" Language: KerML
3+
" Author: Daumantas Kavolis <[email protected]>
4+
" Last Change: 2025-10-03
5+
6+
" Only do this when not done yet for this buffer
7+
if exists("b:did_ftplugin")
8+
finish
9+
endif
10+
11+
" Don't load another plugin for this buffer
12+
let b:did_ftplugin = 1
13+
14+
" Set 'comments' to format dashed lists in comments.
15+
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1://*,mb:*,ex:*/,:///,://
16+
setlocal commentstring=//*\ %s\ */
17+
18+
" Set 'formatoptions' to break comment lines but not other lines,
19+
" and insert the comment leader when hitting <CR> or using "o"
20+
setlocal formatoptions-=t
21+
setlocal formatoptions+=croql
22+
23+
let b:undo_ftplugin = 'setlocal comments< commentstring< formatoptions<'

runtime/ftplugin/sysml.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
" Vim filetype plugin
2+
" Language: SysML
3+
" Author: Daumantas Kavolis <[email protected]>
4+
" Last Change: 2025-10-03
5+
6+
" Only do this when not done yet for this buffer
7+
if exists("b:did_ftplugin")
8+
finish
9+
endif
10+
11+
" Behaves mostly just like KerML, only differs by keywords
12+
runtime! ftplugin/kerml.vim

src/testdir/test_filetype.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ def s:GetFilenameChecks(): dict<list<string>>
423423
karel: ['file.kl', 'file.KL'],
424424
kconfig: ['Kconfig', 'Kconfig.debug', 'Kconfig.file', 'Config.in', 'Config.in.host'],
425425
kdl: ['file.kdl'],
426+
kerml: ['file.kerml'],
426427
kitty: ['kitty.conf', '~/.config/kitty/colorscheme.conf'],
427428
kivy: ['file.kv'],
428429
kix: ['file.kix'],
@@ -781,6 +782,7 @@ def s:GetFilenameChecks(): dict<list<string>>
781782
swiftgyb: ['file.swift.gyb'],
782783
swig: ['file.swg', 'file.swig'],
783784
sysctl: ['/etc/sysctl.conf', '/etc/sysctl.d/file.conf', 'any/etc/sysctl.conf', 'any/etc/sysctl.d/file.conf'],
785+
sysml: ['file.sysml'],
784786
systemd: ['any/systemd/file.automount', 'any/systemd/file.dnssd',
785787
'any/systemd/file.link', 'any/systemd/file.mount',
786788
'any/systemd/file.netdev', 'any/systemd/file.network',

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,8 @@ static char *(features[]) =
729729

730730
static int included_patches[] =
731731
{ /* Add new patch number below this line */
732+
/**/
733+
1829,
732734
/**/
733735
1828,
734736
/**/

0 commit comments

Comments
 (0)