lukas-reineke / lsp-format.nvim

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

[Feature Request] Dont add the format to undo #57

Closed ofirgall closed 1 year ago

ofirgall commented 1 year ago

Hey, I use autosave and it works great with this plugin, but the format adds to the undo history, when I want to undo a change I need to do it twice, once for the format and once for the actual change

lukas-reineke commented 1 year ago

I don't think this is a good idea as the default. Formatting is a separate change from the edit you made before. Users should be able to undo them independently. But I'd be fine to add an option for this. I probably don't have time to work on this for a while, though. Feel free to make a PR. Should be pretty easy to implement. It would look a lot like the force option.

Mange commented 1 year ago

I agree. Sometimes I don't like the formatting, and it's useful to be able to u :FormatDisable and then save again.