When in vim-mode, moving the cursor to or from a line with folded content (either sub-points in a bullet lists or a folded section) will often expand it, with the cursor landing in the expanded section.
Steps to reproduce
Enable vim mode.
Create a nested list, and fold the top-level bullets points.
Use j/k or up/down arrow keys to navigate between the top-level bullet points in normal mode.
(Failure happens more often if the top-level bullet points are long enough to wrap.)
The cursor moves between the top-level bullet points.
Often (but not always) the bullet point that the cursor moves to or from will expand (unfold), and the cursor will move to the first or last of the expanded items.
- Operating system: macOS 11.2.1
- Obsidian version: v.0.11.3
When I move cursor in Vim mode from a fold line with key j / k, it unfold automatically sometimes according cursor position or just to expand with no condition, but it doesn’t apperence in the edit mode. So I have to move the cursor with mouse or in edit mode to prevent it unfold.
I have reported to the plugin Outliner’s author, and as he said it is like an Obsidian’s vim mode problem.
Please take a look on it, appreciate for all your efforts!
- System: MacOS 11.2.3
- Obsidian Version: 11.13 the latest version right now.
I have the same problem. I found minimal steps to reproduce:
- Write this in obsidian:
- Fold the second bullet
- Place cursor at x
- Press j
- (optional) sometimes you have to move up and down once more (kj)
So they get unfolded if the cursor is at a character far to the right, and we move to a short line (cursor position > new line length). Does anyone have any idea why that may happen?
This issue makes folding in vim mode almost unusable
It looks that they may be two separate issues.
I also experienced the one @lukas describes, but I fixed it by remapping:
nmap j gj
nmap k gk
with the vimrc pluggin.