Closed Zhou-Yicheng closed 1 year ago
Experiencing same issue
It's reproducible yes.
But strangely
[!NOTE] I face this issue in general when using nvim-ufo. (e.g) undoing inside a file (not specific to
.org
)
This is really an issue with UFO in some aspects. A good work around is to disable UFO in org buffers. I ran into this myself just now while migrating to orgmode.
Here's how I disable UFO in certain buffers:
local ft_options = {
norg = "", -- Neorg had the same issue
org = "" -- We "disable" ufo in org files by giving back an empty provider to UFO
}
require('ufo').setup({
provider_selector = function(_, filetype, _)
return ft_options[filetype] or { "treesitter", "indent" }
end,
})
I still get folding in org
files without the weird "auto-folding" going on from UFO. Recommend you give it a shot.
@treatybreaker This didn't solve the issue on #614 Thanks for sharing anyway! but using:
vim.cmd [[setlocal nofoldenable]] -- No folds initially
disables folds. You can use it with an autocmd.
@treatybreaker This didn't solve the issue on #614 Thanks for sharing anyway! but using:
vim.cmd [[setlocal nofoldenable]] -- No folds initially
disables folds. You can use it with an autocmd.
It still seems as though UFO's folds are much superior to what we get out the gate with orgmode here.
nofoldenable
still leads to some folds being incorrectly calculated like in #614, UFO works around that but introduces the esc/undo
bug here.
Somewhat frustrating, I think I'll set aside some time later to find the root cause.
Hey @Zhou-Yicheng, @UTFeight, @m3xan1k,
With the merging of #615 UFO should play nice with Orgmode if you set org_startup_folded
to inherit
or showeverything
.
require("orgmode").setup({
-- ...
org_startup_folded = "inherit"
})
Give it a shot, that fixes UFO issues for me.
The issue solved! Thanks for the PR!
Describe the bug
Fold automatically every time type
ESC
in insert modeSteps to reproduce
:TSUpdate org
ESC
Expected behavior
Back to normal mode without folding
Emacs functionality
No response
Minimal init.lua
Screenshots and recordings
No response
OS / Distro
Gentoo 2.14
Neovim version/commit
v0.9.1
Additional context
No response