robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqvim-patch:9.2.0969: runtime(shaderslang): matchit % breaks on braces (#41371)53211ade2b

master
1.5 KiB51 linesraw
1" Vim filetype plugin file
2" Language:	Slang
3" Maintainer:	Austin Shijo <epestr@proton.me>
4" Last Change:	2026 Aug 16
5
6" Only do this when not done yet for this buffer
7if exists("b:did_ftplugin")
8  finish
9endif
10
11" Don't load another plugin for this buffer
12let b:did_ftplugin = 1
13
14" Using line continuation here.
15let s:cpo_save = &cpo
16set cpo-=C
17
18let b:undo_ftplugin = "setl fo< com< cms< inc<"
19
20" Set 'formatoptions' to break comment lines but not other lines,
21" and insert the comment leader when hitting <CR> or using "o".
22setlocal fo-=t fo+=croql
23
24" Set comment string (Slang uses C-style comments)
25setlocal commentstring=//\ %s
26
27" Set 'comments' to format dashed lists in comments
28setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
29
30" When the matchit plugin is loaded, this makes the % command skip parens and
31" braces in comments properly
32if exists("loaded_matchit")
33  let b:match_words = '^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>'
34  let b:match_skip = 's:comment\|string\|character\|special'
35  let b:match_ignorecase = 0
36  let b:undo_ftplugin ..= " | unlet! b:match_skip b:match_words b:match_ignorecase"
37endif
38
39" Win32 and GTK can filter files in the browse dialog
40if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
41  let b:browsefilter = "Slang Source Files (*.slang)\t*.slang\n"
42  if has("win32")
43    let b:browsefilter ..= "All Files (*.*)\t*\n"
44  else
45    let b:browsefilter ..= "All Files (*)\t*\n"
46  endif
47  let b:undo_ftplugin ..= " | unlet! b:browsefilter"
48endif
49
50let &cpo = s:cpo_save
51unlet s:cpo_save