Closed SlayerOfTheBad closed 3 months ago
By visible
you mean folded? Why would we ignore the folded ones?
In nvim-orgmode, visibility of headlines is simulated using folding, since we don't have true invisible lines in neovim.
If my interface visually looks like an Emacs equivalent, I expect it to behave the same as the Emacs equivalent. So if I can see the headings for lines 2, 5, and 7, I expect next-visible-heading
to bring me from 2 to 5, and not a folded line 4.
I have updated the description with videos illustrating the difference in behaviour between nvim-orgmode and Emacs' Orgmode.
Thanks for the videos, now I understood the issue. Your PR is merged. Thanks!
Describe the bug
When
org-next-visible-heading
(OrgMappings:next_visible_heading()
) is called, the cursor is moved to the next heading, regardless of whether it is visible or not.Steps to reproduce
Assume a file
Collapse this to show as
vim.cmd([[norm gg]])
)OrgMappings:next_visible_heading
twice. (vim.cmd([[norm }}]])
)Actual behaviour: Cursor is present at
** Heading 1.1
(Internally at*** Heading 1.1.1
)Expected behavior
Have cursor present at
** Heading 1.2
.Emacs functionality
Exists in Emacs Orgmode - Moves to
** Heading 1.2
Minimal init.lua
Not relevant for reproducing the bug.
Screenshots and recordings
cut-nvim.webm cut-emacs.webm
OS / Distro
Arch Linux & Ubuntu 24.04
Neovim version/commit
NVIM v0.10.1 & NVIM v0.10.1-dev-9+g671073e71
Additional context
I have fixed this already and created a pull request. https://github.com/nvim-orgmode/orgmode/pull/773