robin/laufey

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

Christian Clasonvim-patch:9.1.0464: no whitespace padding in commentstring option in ftplugins2f5b8a0092

master
1.5 KiB55 linesraw
1" Vim filetype plugin file
2" Language:	Modula-2
3" Maintainer:	Doug Kearns <dougkearns@gmail.com>
4" Last Change:	2024 Jan 14
5" 		2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring')
6
7if exists("b:did_ftplugin")
8  finish
9endif
10let b:did_ftplugin = 1
11
12let s:cpo_save = &cpo
13set cpo&vim
14
15let s:dialect = modula2#GetDialect()
16
17if s:dialect ==# "r10"
18  setlocal comments=s:(*,m:\ ,e:*),:!
19  setlocal commentstring=!\ %s
20else
21  setlocal commentstring=(*\ %s\ *)
22  setlocal comments=s:(*,m:\ ,e:*)
23endif
24setlocal formatoptions-=t formatoptions+=croql
25
26let b:undo_ftplugin = "setl com< cms< fo<"
27
28if exists("loaded_matchit") && !exists("b:match_words")
29  let b:match_ignorecase = 0
30  " the second branch of the middle pattern is intended to match CASE labels
31  let b:match_words = '\<REPEAT\>:\<UNTIL\>,' ..
32	\	      '\<\%(BEGIN\|CASE\|FOR\|IF\|LOOP\|WHILE\|WITH\|RECORD\)\>' ..
33	\		':' ..
34	\		'\<\%(ELSIF\|ELSE\)\>\|\%(^\s*\)\@<=\w\+\%(\s*\,\s*\w\+\)\=\s*\:=\@!' ..
35	\		':' ..
36	\	      '\<END\>,' ..
37	\	      '(\*:\*),<\*:\*>'
38  let b:match_skip = 's:Comment\|Pragma'
39  let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_skip b:match_words"
40endif
41
42if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
43  let b:browsefilter = "Modula-2 Source Files (*.def, *.mod)\t*.def;*.mod\n"
44  if has("win32")
45    let b:browsefilter ..= "All Files (*.*)\t*\n"
46  else
47    let b:browsefilter ..= "All Files (*)\t*\n"
48  endif
49  let b:undo_ftplugin ..= " | unlet! b:browsefilter"
50endif
51
52let &cpo = s:cpo_save
53unlet s:cpo_save
54
55" vim: nowrap sw=2 sts=2 ts=8 noet: