lukas-reineke / lsp-format.nvim

A wrapper around Neovims native LSP formatting.
559 stars 27 forks source link

messes up files when writing into multiple files at once with multiple formating lsp providers #58

Open vitaly opened 1 year ago

vitaly commented 1 year ago

how to reproduce:

vim will start writing into all those files and lsp-format will endup with file contents mixed between the files. e.g. file foo will have content of file bar, which, in turn will have content of file baz etc.

lukas-reineke commented 1 year ago

I found some issues when writing a buffer that is not the current one, I made a PR here https://github.com/lukas-reineke/lsp-format.nvim/pull/59 But none of those issues would write content from one buffer into another, and I also can't reproduce that :thinking:

Can you check if the PR changes anything?

lparry commented 1 year ago

Is there a config option to not format anything except the focused buffer? I'm not sure if it's exactly the same thing as this issue, but I seem to get stuck in loops where if I save a file, every other buffer ends up with changes preventing :q, so I change buffer, :w and now every buffer is touched again. non-focused formatting just feels unhelpful

lukas-reineke commented 1 year ago

this is a different issue, and it should not happen. Can you make a new ticket with steps to reproduce?