Skip to content

fix(window): flush the buffer with an autocmd#16

Open
DrKJeff16 wants to merge 3 commits intoNeoSahadeo:mainfrom
DrKJeff16:fix/buf-flush
Open

fix(window): flush the buffer with an autocmd#16
DrKJeff16 wants to merge 3 commits intoNeoSahadeo:mainfrom
DrKJeff16:fix/buf-flush

Conversation

@DrKJeff16
Copy link
Copy Markdown
Contributor

@DrKJeff16 DrKJeff16 commented Oct 4, 2025

Description

I believe I solved the buffer not flushing, even with <C-o>. I used a BufLeave autocommand for it to trigger.
Comments have been added to specify what's been done.

I reuse the 'lsp-toggle' augroup (not clearing it this time).

@DrKJeff16 DrKJeff16 requested a review from NeoSahadeo as a code owner October 4, 2025 18:08
@NeoSahadeo
Copy link
Copy Markdown
Owner

Super strange that the LSP does not get removed from the context. It's a small issue, which is that the "astro" lsp should not be displaying the typescript file.

Probably has to do with the way nvim handles lsp contexts; probably.

image image

@NeoSahadeo NeoSahadeo added the minor issue Issues that will not effect the use of the application label Oct 5, 2025
@DrKJeff16
Copy link
Copy Markdown
Contributor Author

DrKJeff16 commented Oct 5, 2025

@NeoSahadeo I have been experiencing similar LSP issues. My own plugin (unrelated use case) is struggling with stuff like that, so perhaps Neovim devs are yet to perfect the LSP Core? Either way, I will look into it.

That being said, what exactly do you mean by "flushing" the buffer? Do you mean detaching unavailable LSP clients?

@DrKJeff16
Copy link
Copy Markdown
Contributor Author

DrKJeff16 commented Oct 5, 2025

BTW Me doing force-pushes is just me rebasing with main (syncing). Probably squashing, too.

@DrKJeff16
Copy link
Copy Markdown
Contributor Author

DrKJeff16 commented Oct 5, 2025

Update

@NeoSahadeo I've added a check in each client table to determine if the respective LSP client is attached to any buffers (975f044).

See vim.lsp.Client type. The attached_buffers field.

Signed-off-by: Guennadi Maximov C <g.maxc.fox@protonmail.com>
Signed-off-by: Guennadi Maximov C <g.maxc.fox@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor issue Issues that will not effect the use of the application

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants