jceb / vim-orgmode

Text outlining and task management for Vim based on Emacs' Org-Mode
http://www.vim.org/scripts/script.php?script_id=3642
Other
3.1k stars 266 forks source link

Unexpected behaviour when jumping to next header #342

Open doak opened 4 years ago

doak commented 4 years ago

As stated in documentation, ]] should jump to next header of same level. Although not stated explicitly, I would assume that it jumps to the next upper level, if there is no same level. In contrast the current implementation jumps to a more nested layer which IMHO is not the desired behaviour. This is even more confusing if that level three is folded (not visible).

Please consider the following example:

* LEVEL 0
* LEVEL 1
** LEVEL 1.1
*** LEVEL 1.1.1
** LEVEL 1.2
*** LEVEL 1.2.1
*** LEVEL 1.2.2
* LEVEL 2
** LEVEL 2.1
** LEVEL 2.2
* LEVEL 3

Use ]] on LEVEL 1.2 jumps to LEVEL 1.2.1, but not to LEVEL 2 as I would expect. If any case, documentation should express the designed behaviour explicitly.

I am using current master (v0.6.0-28-gc6cd668).

doak commented 4 years ago

Btw. jumping to previous header ([[) works like expected, hence there is a mismatch in behaviour.