kevinhwang91 / nvim-ufo

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

[Ques] Folds are open after formatting #205

Closed niksingh710 closed 3 months ago

niksingh710 commented 3 months ago

Neovim version (nvim -v | head -n1)

NVIM v0.9.5

Operating system/version

Arch linux

i use manual formatting (LSP) if i format my file having few functions folded it opens all the folds.

Expected behavior

After format the part that is folded should be folded and the part that is not folded should be kept like that.

Actual behavior

opens all folds when formatted.

These are my selection provider.

{ "lsp", "indent" }
kevinhwang91 commented 3 months ago

https://github.com/kevinhwang91/nvim-ufo/issues/107

Jeppelelle commented 3 months ago

107

Is this really a duplicate? I use https://github.com/ray-x/go.nvim & everything has worked as expected until yesterday, close_fold_kinds changed to close_fold_kinds_for_ft, so i updated my config from close_fold_kinds = {} to close_fold_kinds_for_ft = {}, no luck though, all folds open during gofmt even though folds stayed closed in prior ufo versions

107

issue was about support for range formatting, but this new issue exist even when the lsp supports range formatting