vim-terraform
vim-terraform copied to clipboard
Block comments converting to highlighted during navigation
I frequently use block comments to disable sections of terraform code using /* to start disabling and */ to complete. As expected, the code will turn "grey" and lose syntax highlights.
However, when I move the cursor so that the opening /* scrolls off the top of the screen, the previously "grey" code suddenly starts highlighting again. If I stop moving and CTRL-L to redraw the problem goes away and the code goes "grey" again - although in some unidentified cases redraw never fixes this - it's a little frustrating as I never am sure what code is live or not.
I'm on Windows, using VIM 9.0, the vim-terraform pack, gruvbox colorscheme
I believe I did not have this issue to such a great extent with Vim 8.0. I recall attempting Vim 8.2 and reverting to 8.0 after a few days and I'm only seeing this issue again since updating to 9.0
(also submitted here https://vi.stackexchange.com/questions/42221/block-comment-syntax-colouring-being-lost-while-moving-but-redraw-will-fix)
you probably want something to do with syntax sync.
These days I use treesitter for my syntax highlighting so I'm not especially motivated to dig into this. However I'm open to merge requests, if you come up with something convincing.
some years ago I contributed https://github.com/nathanalderson/yang.vim/blob/0edaeb616be8f66caed2c888095446006fd4a6fa/syntax/yang.vim#LL107C1-L107C47 to another syntax to deal with a similar case, perhaps something like that here
but I admit that I forget now how or why that works