mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
91dc04a5e1
Problem: Modula2 filetype support lacking
Solution: Improve the Modula-2 runtime support, add additional modula2
dialects, add compiler plugin, update syntax highlighting,
include syntax tests, update Makefiles (Doug Kearns)
closes: vim/vim#6796
closes: vim/vim#8115
68a8947069
- Luaify the detection script:
- Split the `(*!m2foo*)` and `(*!m2foo+bar*)` detection into two Lua patterns,
as Lua capture groups cannot be used with `?` and friends (as they only work
on character classes).
- Use `vim.api.nvim_buf_call()` (ew) to call `modula2#SetDialect()` to ensure
`b:modula2` is set for the given bufnr.
- Skip the syntax screendump tests. (A shame as they test some of the detection
from `(*!m2foo+bar*)` tags, but I tested this locally and it seems to work)
- Port the synmenu.vim changes from Vim9 script. (Also tested this locally)
- (And also add the missing comma for `b:browsefilter` from earlier.)
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
17 lines
383 B
VimL
17 lines
383 B
VimL
" Vim syntax file
|
|
" Language: Modula-2
|
|
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
|
" Previous Maintainer: pf@artcom0.north.de (Peter Funk)
|
|
" Last Change: 2024 Jan 04
|
|
|
|
if exists("b:current_syntax")
|
|
finish
|
|
endif
|
|
|
|
let dialect = modula2#GetDialect()
|
|
exe "runtime! syntax/modula2/opt/" .. dialect .. ".vim"
|
|
|
|
let b:current_syntax = "modula2"
|
|
|
|
" vim: nowrap sw=2 sts=2 ts=8 noet:
|