-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: clear lsp references on ui open #30
base: main
Are you sure you want to change the base?
Conversation
Thanks for bringing this problem to me! I wonder if it is more useful when you clear lsp highlights in an BufLeave autocmd? And you can use |
I found related code in AstroNvim, maybe we can also add BufLeave event to AstroNvim, to clear lsp highlights when you enter another buffer (a vsplit or :h). |
Hmmm, yes, i'm currently using my own autocmd for this, but you might be right this probably is not needed in ssr, if people don't have that function implemented them selves they will not have this "side effect" I'll have this solved in astro. :) |
No I think it's useful to clear lsp highlights in ssr.nvim. If you change the PR to use |
I've found a pretty bad bug that is the root of some issues, ill be doing some testing and ill get back to you once i figure everything EDIT: an autocmd also may not be the best choice, autocmd is typicality used when you want to automate a function execution, but in our case with SSR we are always executing |
aah something i didn't think of, if people leave ssr active while editing code in this case yeah the autocmd makes sense, this was an oversight on my part as i typically don't use ssr like that. |
SSR creates instances when you Ui:Open but the autocmds are not treated like an instance they are sharing the same autocmds, these autocmds how ever are being duplicated on each run of Ui:Open causing bad side effects like data invalidation changes in this commit creates a unique augroup and allows only one autocmd per instance then removes them once the instance is closed.
e38f2cf
to
7602055
Compare
need to merge #32 before this PR. |
If you're hovering over text with a LSP, it highlights all the references, when entering SSR these highlights persist, this can be visually noisy
Before:
before.mp4
After:
after.mp4