When I edit VIM syntax highlighting definitions or any other VIM script file (*.vim), I lose syntax highlighting on lines that are continued from the previous one. For example,
syntax region LongRegionNameToTakeUpSpaceOnThisLine matchgroup=String
\ oneline contained start=+"+ end=+"+ skip=+\\"+
\ contains=Foo,Bar containedin=AnotherRegion
should have full syntax highlighting for all three lines (i.e., "contains," "containedin," "skip," "start," "end," "oneline," and "contained" should all be highlighted as key words, just like "matchgroup" is). Instead, I only get highlighting on the first line.
Does this happen for other users, too, or is it specific to my installation or something in my settings? I can confirm that it is still not working if I don't source my vimrc (e.g., "vim -u NONE test.vim").
This used to work in VIM 7.3 (on Fedora), but VIM 7.4 (Ubuntu 16.04.6), VIM 8.2 (Fedora 34), and VIM 9.0 (Fedora 35) don't work correctly for me unless I fall back to an old syntax definition file (vim.vim). I can't find anything really obvious in the syntax definition files that changed for the linecont code.
:version). – Martin Tournoij Jul 27 '22 at 08:29vim -u DEFAULTS -U NONE, paste,:setf vimand the highlight is wrong until I join the continued lines. OTOH, a random script in my dotfiles with line continuations works fine. – D. Ben Knoble Jul 27 '22 at 14:56vimIsCommandsyntax group. – filbranden Jul 27 '22 at 21:58This basically replaces skip="\\|\|" with skip="\n\s*\"
– karlh Jul 28 '22 at 03:46\\character at the start of the line as I thought that's what the question was about, and not the rest – Martin Tournoij Jul 28 '22 at 06:53