Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block comments converting to highlighted during navigation #181

Open
pmcevoy opened this issue May 19, 2023 · 2 comments
Open

Block comments converting to highlighted during navigation #181

pmcevoy opened this issue May 19, 2023 · 2 comments

Comments

@pmcevoy
Copy link

pmcevoy commented May 19, 2023

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)

@dimbleby
Copy link
Contributor

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.

@dimbleby
Copy link
Contributor

dimbleby commented May 19, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants