mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 9.0.2128: runtime(swig): add syntax and filetype plugins
Add syntax and filetype plugins for SWIG (Simplified Wrapper Interface Generator) description files. The default syntax for .i files highlights comments in a reverse color scheme which doesn't look well. This syntax builds on vim's c++ syntax by adding highlighting for common swig directives and user defined directives. For an alternative syntax, see vimscript #1247 (which I found after writing this). closes: #13562 Co-authored-by: Matěj Cepl <mcepl@cepl.eu> Co-authored-by: Julien Marrec <julien.marrec@gmail.com> Signed-off-by: Julien Marrec <julien.marrec@gmail.com> Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
e214692718
commit
2e31065a65
@@ -673,6 +673,7 @@ def s:GetFilenameChecks(): dict<list<string>>
|
||||
swayconfig: ['/home/user/.sway/config', '/home/user/.config/sway/config', '/etc/sway/config', '/etc/xdg/sway/config'],
|
||||
swift: ['file.swift'],
|
||||
swiftgyb: ['file.swift.gyb'],
|
||||
swig: ['file.swg', 'file.swig'],
|
||||
sysctl: ['/etc/sysctl.conf', '/etc/sysctl.d/file.conf', 'any/etc/sysctl.conf', 'any/etc/sysctl.d/file.conf'],
|
||||
systemd: ['any/systemd/file.automount', 'any/systemd/file.dnssd',
|
||||
'any/systemd/file.link', 'any/systemd/file.mount',
|
||||
@@ -2340,4 +2341,34 @@ func Test_vba_file()
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
func Test_i_file()
|
||||
filetype on
|
||||
|
||||
" Swig: keyword
|
||||
call writefile(['%module mymodule', '/* a comment */'], 'Xfile.i', 'D')
|
||||
split Xfile.i
|
||||
call assert_equal('swig', &filetype)
|
||||
bwipe!
|
||||
|
||||
" Swig: verbatim block
|
||||
call writefile(['%{', '#include <header.hpp>', '%}'], 'Xfile.i', 'D')
|
||||
split Xfile.i
|
||||
call assert_equal('swig', &filetype)
|
||||
bwipe!
|
||||
|
||||
" ASM
|
||||
call writefile(['; comment', ';'], 'Xfile.i', 'D')
|
||||
split Xfile.i
|
||||
call assert_equal('asm', &filetype)
|
||||
bwipe!
|
||||
|
||||
" *.i defaults to progress
|
||||
call writefile(['looks like progress'], 'Xfile.i', 'D')
|
||||
split Xfile.i
|
||||
call assert_equal('progress', &filetype)
|
||||
bwipe!
|
||||
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
@@ -704,6 +704,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2128,
|
||||
/**/
|
||||
2127,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user