Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zm and zr not working? #49

Closed
ziontee113 opened this issue Jul 14, 2022 · 5 comments
Closed

zm and zr not working? #49

ziontee113 opened this issue Jul 14, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@ziontee113
Copy link

Neovim version (nvim -v | head -n1)

0.7

Operating system/version

Arch Linux

How to reproduce the issue

Pressing zm and zr

Expected behavior

Close / Open all folds by 1 level.

Actual behavior

Nothing happens.

Using ufo zR and zM works fine, but not zm and zr, they just do nothing.

vim.keymap.set("n", "zR", require("ufo").openAllFolds)
vim.keymap.set("n", "zM", require("ufo").closeAllFolds)
@ziontee113 ziontee113 added the bug Something isn't working label Jul 14, 2022
@kevinhwang91
Copy link
Owner

It should work as expected when folelevel is small.

foldmethod=manual should better set a large value for foldlevel. I have no idea how to maintain a my_foldlevel to make zm and zr work like small foldlevel.

@ziontee113
Copy link
Author

Oh thanks, I just copied the sample code that sets foldlevel=99. Setting it to 1 solves the problem, I'll experiment with it further.

@ziontee113
Copy link
Author

Actually setting foldlevel to 1 is stupid. I changed it back to 99 and use vim.o.foldlevelstart = 0. Works fine for now :)

@kevinhwang91
Copy link
Owner

kevinhwang91 commented Jul 14, 2022

With a small foldlevel, users should better call require('ufo').disableFold(bufnr) and require('ufo').enableFold(bufnr) by themselves.

@ziontee113
Copy link
Author

ziontee113 commented Jul 14, 2022

I think having -1 foldlevelstart screws up zm and zr for some reason. If I set it to -1 zm and zr just do absolutely nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants