diff options
author | Julien Marrec <julien.marrec@gmail.com> | 2023-11-25 15:30:46 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-11-25 15:30:46 +0100 |
commit | 2e31065a650015892179e520038bf2083a9519b6 (patch) | |
tree | 11606cc1f0564adcb22bbbb52f5954aa6b049ee8 /src | |
parent | e214692718d6a997a0540fc688e1417564416f80 (diff) |
patch 9.0.2128: runtime(swig): add syntax and filetype pluginsv9.0.2128
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/testdir/test_filetype.vim | 31 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 483d01b89b..0018bbabfc 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -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 diff --git a/src/version.c b/src/version.c index 6f3397e98e..a9d0bdd2b4 100644 --- a/src/version.c +++ b/src/version.c @@ -705,6 +705,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2128, +/**/ 2127, /**/ 2126, |