syntax should sync from higher up in the file
namedots opened this issue · 2 comments
Problem:
When the top of the screen is in the middle of a multiline string, everything becomes green (the color of my strings) this occurs when the file is updated by syntastic or elm-format.
Suggested Solution:
I propose adding the following to the syntax file:
syn sync minlines 2000
see :h syn-sync-minlines
I do not know what the interaction is if vim starts looking in the middle of a multiline string 2000 lines above.
A number other than 2000 might be preferred, that's just what happens to be in the python syntax I happened to look in for reference - that's no promise about 2000 being a reasonable number.
Workaround:
Add the following to ~/.vim/after/syntax/elm.vim
:
syn sync fromstart
:h syn-sync-first
Noticed the same issue - the suggested workaround worked for me. Thanks!