문제

I want to highlight all the lines starting with a dot as C code:

syntax include @CSYN syntax/c.vim
syntax region cSnip matchgroup=Snip start=/^\./ end=/$/ contains=@CSYN

It works OK, unless there's an { on the end of the line:

.while(1) {
xxx

In such case the xxx string is highlighted as if it was an C identifier.

How can I switch C syntax highlighting off at the end of the line?

도움이 되었습니까?

해결책

This should be preventable by adding the keepend keyword to the :syntax region definition. Also, since your inclusion only spans a single line, the oneline keyword can be added, too.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top