Closed ranjithshegde closed 2 years ago
this is nvim's expected behavior. :h foldlevel
foldlevelstart
I am not sure that it’s updated this way when you exit insert mode. As I don’t have this issue when I use built in indent or treesitter as my fold method
I may have made a mistake in my understanding. Wait for someone with more experience to explain
You should increase the foldlevel and trace the value after you go back normal mode verb set foldlevel
Sorry for my ignorance, but how do I do that? shouldnt za
or zo
do that automatically?
set foldlevel=99 foldlevelstart=-1
set foldlevel=99 foldlevelstart=-1
This fixes the collapse problem but all folds are always open until I manually close them, even at BufEnter
also - was my mistakerequire("ufo").closeAllFolds()
has no affect until I first manually close all folds
You can create some autocmds to implement your requirements, but these are not related to this plugin
set foldlevel=99 foldlevelstart=-1
This fixes the collapse problem but all folds are always open until I manually close them, even at
BufEnter
alsorequire("ufo").closeAllFolds()
has no affect until I first manually close all folds
Create folds is async, your event can't work is expected. I think you should write the function yourself. It's not the normal workflow, sorry.
Create folds is async, your event can't work is expected. I think you should write the function yourself. It's not the normal workflow, sorry.
I understand that this might not be the plugin focus, but using za
or zo
which is basically opening a specifc fold (also what you do in your intro video, just with mouse) is a very common workflow.
But I fully appreciate if you dont want to support this. I will give it a shot.
thanks for the plugin and the excellent work!
Create folds is async, your event can't work is expected. I think you should write the function yourself. It's not the normal workflow, sorry.
I understand that this might not be the plugin focus, but using
za
orzo
which is basically opening a specifc fold (also what you do in your intro video, just with mouse) is a very common workflow.But I fully appreciate if you dont want to support this. I will give it a shot.
thanks for the plugin and the excellent work!
Every time update folding, vim respect the fold level. I suggest you set the value as large enough, otherwise, it's buggy for ufo while you are editing buffer because the level may change a lot.
Every time update folding, vim respect the fold level. I suggest you set the value as large enough, otherwise, it's buggy for ufo while you are editing buffer because the level may change a lot.
Are you referring to foldlevelstart
?
No, foldlevel
, you should RTFM before customizing or hacking any plugins.
Neovim version (nvim -v | head -n1)
NVIM v0.8.0-dev+452-gb2ed439bd5
Operating system/version
Linux 5.18.5-arch1-1 #1 SMP PREEMPT_DYNAMIC (arch linux)
How to reproduce the issue
local function level2()
za
(toggle fold under cursor) orzo
(open fold under cursor)<esc>
to go to normal mode ...Expected behavior
Folds under the cursor that are opened manually with
za
orzo
remain open (so that i can inspect what I just changed, or any other purpose)Actual behavior
all folds have been closed