kevinhwang91 / nvim-ufo

Not UFO in the sky, but an ultra fold in Neovim.
BSD 3-Clause "New" or "Revised" License
2.18k stars 38 forks source link

Is it possible to stop folds from opening when code is formatted? #107

Open joshstobbs opened 1 year ago

joshstobbs commented 1 year ago

Feature description

This is less of a request and more of a question, just unsure which place to put this, when my code is formatted (say through null-ls) all of my folds are automatically opened.

Describe the solution you'd like

The question I suppose, is that something that has to happen or could it be avoided?

Thanks so much for this plugin, it truly is incredible!

Additional context

No response

kevinhwang91 commented 1 year ago

Depend on whether your formatting provider support range formatting.

MariaSolOs commented 1 year ago

@kevinhwang91 sorry to revive this issue, but could you please elaborate? Say that the client does support range formatting. In that case should it just work, or is there extra configuration needed?

kevinhwang91 commented 1 year ago

@kevinhwang91 sorry to revive this issue, but could you please elaborate? Say that the client does support range formatting. In that case should it just work, or is there extra configuration needed?

If your LSP client support range formatting, no need to configure anything.

niksingh710 commented 4 months ago

does stylua support range formatting?

kevinhwang91 commented 4 months ago

does stylua support range formatting?

You can use a ls server like https://github.com/mattn/efm-langserver to provide range formatting.

mercibac commented 1 month ago

Any update on this issue ? Is there any solution to avoid nvim-ufo automatically closing all folds when:

Can the solution works with the most popular LSP configuration: nvim-lspconfig + Mason ?