diff options
author | Christian Clason <c.clason@uni-graz.at> | 2023-11-25 16:06:58 +0100 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2023-11-26 00:41:59 +0100 |
commit | 38e98754a556404b54d3c28b4272bcacbc3b6b0e (patch) | |
tree | 1c2ea09cbf7151b1135da6ede154837d9baece89 /test/old | |
parent | ba88fd886ae871025719dfc8602072cc51ce5407 (diff) | |
download | rneovim-38e98754a556404b54d3c28b4272bcacbc3b6b0e.tar.gz rneovim-38e98754a556404b54d3c28b4272bcacbc3b6b0e.tar.bz2 rneovim-38e98754a556404b54d3c28b4272bcacbc3b6b0e.zip |
vim-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 vim/vim#1247 (which I found after writing this).
closes: vim/vim#13562
https://github.com/vim/vim/commit/2e31065a650015892179e520038bf2083a9519b6
Co-authored-by: Julien Marrec <julien.marrec@gmail.com>
Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
Diffstat (limited to 'test/old')
-rw-r--r-- | test/old/testdir/test_filetype.vim | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim index b45895d608..f197039ec5 100644 --- a/test/old/testdir/test_filetype.vim +++ b/test/old/testdir/test_filetype.vim @@ -633,6 +633,7 @@ func s:GetFilenameChecks() abort \ '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', 'any/systemd/file.netdev', 'any/systemd/file.network', 'any/systemd/file.nspawn', 'any/systemd/file.path', 'any/systemd/file.service', 'any/systemd/file.slice', 'any/systemd/file.socket', 'any/systemd/file.swap', 'any/systemd/file.target', 'any/systemd/file.timer', '/etc/systemd/some.conf.d/file.conf', '/etc/systemd/system/some.d/file.conf', '/etc/systemd/system/some.d/.#file', '/etc/systemd/system/.#otherfile', '/home/user/.config/systemd/user/some.d/mine.conf', '/home/user/.config/systemd/user/some.d/.#file', '/home/user/.config/systemd/user/.#otherfile', '/.config/systemd/user/.#', '/.config/systemd/user/.#-file', '/.config/systemd/user/file.d/.#', '/.config/systemd/user/file.d/.#-file', '/.config/systemd/user/file.d/file.conf', '/etc/systemd/file.conf.d/file.conf', '/etc/systemd/system/.#', '/etc/systemd/system/.#-file', '/etc/systemd/system/file.d/.#', '/etc/systemd/system/file.d/.#-file', '/etc/systemd/system/file.d/file.conf', '/systemd/file.automount', '/systemd/file.dnssd', '/systemd/file.link', '/systemd/file.mount', '/systemd/file.netdev', '/systemd/file.network', '/systemd/file.nspawn', '/systemd/file.path', '/systemd/file.service', '/systemd/file.slice', '/systemd/file.socket', '/systemd/file.swap', '/systemd/file.target', '/systemd/file.timer', 'any/.config/systemd/user/.#', 'any/.config/systemd/user/.#-file', 'any/.config/systemd/user/file.d/.#', 'any/.config/systemd/user/file.d/.#-file', 'any/.config/systemd/user/file.d/file.conf', 'any/etc/systemd/file.conf.d/file.conf', 'any/etc/systemd/system/.#', 'any/etc/systemd/system/.#-file', 'any/etc/systemd/system/file.d/.#', 'any/etc/systemd/system/file.d/.#-file', 'any/etc/systemd/system/file.d/file.conf'], \ 'systemverilog': ['file.sv', 'file.svh'], @@ -2248,4 +2249,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 |