nvim-ufo
nvim-ufo copied to clipboard
Open Folds by shifting code
Neovim version (nvim -v | head -n1)
NVIM 7.0
Operating system/version
macOS
How to reproduce the issue
https://user-images.githubusercontent.com/92093874/184601497-9371e74b-d89e-45a5-8d32-dd212aa0aec3.mov
Expected behavior
Does not open fold.
Actual behavior
Open folds by shifting code left or right.
mini.lua
Hey, thank you for your fast response. What you mean with mini.lua?
How to reproduce the issue
in template.
In Packer: use {'kevinhwang91/nvim-ufo', requires = 'kevinhwang91/promise-async'}
nvim-ufo.lua: local status_ok, ufo = pcall(require, "ufo") if not status_ok then return end
ufo.setup({ provider_selector = function(bufnr, filetype, buftype) return {'treesitter', 'indent'} end })
after/plugin/folding.lua: local opt = vim.opt
opt.foldcolumn = "1" opt.foldlevel = 99 opt.foldlevelstart = -1 opt.foldenable = true
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]] vim.o.foldcolumn = '1'
lsp.lua: M.capabilities.textDocument.foldingRange = { dynamicRegistration = false, lineFoldingOnly = true, }
To reproduce the issue: Close a div tag then shift+v and the type < or >
You have edited the text in the folding range, and it must be opened. It's Vim behavior.
I suggest you enhance your < and >. Detect fold whether is closed and then close the selection again.
How i would do it? Sorry I have no experience with neovim and how to write custom functions.
maybe ufo can help, but I am not interesting for now. Set this feature as low priority.
How i would do it? Sorry I have no experience with neovim and how to write custom functions.
h foldclosed() h :foldc
okay, yeah it's only in my opinion important if you refactor large html code. That would help. For other cases it's a low important feature. Thanks for helping.
I suggest you use the format.
I noticed that behaviour as well when i copy or cut an div-tag and paste it in a different location the fold opens. I hope you have some time to implement this. I don't know how difficult it is to implement this feature. But i would be really appreciate it, and it would be cover all cases for folding.
I noticed that behaviour as well when i copy or cut an div-tag and paste it in a different location the fold opens. I hope you have some time to implement this. I don't know how difficult it is to implement this feature. But i would be really appreciate it, and it would be cover all cases for folding.
It's difficult.
https://github.com/kevinhwang91/nvim-ufo/issues/60#issuecomment-1199040389