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.)
Expected result
The cursor moves between the top-level bullet points.
Actual result
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.
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:
- aax
- a
- a
Fold the second bullet
Place cursor at x
Press j
(optional) sometimes you have to move up and down once more (kj)
obsidian v0.12.19
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
This bug is still around and it is what keeps me from switching to obsidian. It makes vim mode unusable with collapsible lists, for me. Would really appreciate a fix.
If the cursor is at the beginning of the line, it won’t unfold, but if the cursor is at the end of the line while navigating (especially when it falls on the 3-dots “…”), it will automatically unfold. It would be nice if it would only unfold when either using a shortcut or clicking the unfold button using mouse. Right now, you can accidentally unfold it while navigating if you’re not super careful where your cursor is.
Hey, here are the steps to reproduce the bug in vim-mode - it depends on the length of the parent section you want to fold.
- [ ] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean commodo suscipit risu
- [ ] Lorem ipsum dolor sit amet,
- [ ] Lorem ipsum dolor sit amet,
- [ ] Lorem ipsum dolor sit amet,
- [ ] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean commodo suscipit risus a mollis.
- [ ] Lorem ipsum dolor sit amet,
- [ ] Lorem ipsum dolor sit amet,
- [ ] Lorem ipsum dolor sit amet,
- [ ] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean commodo suscipit risus a mollis. Class aptent taciti sociosqu ad litora
- [ ] Lorem ipsum dolor sit amet,
- [ ] Lorem ipsum dolor sit amet,
- [ ] Lorem ipsum dolor sit amet,
In this example are three foldable parent sections.
The first one fits in one line, the second one fits in two lines if you got the cursor on the checkbox at the beginning, the third one only fits in two lines. NOTE: To reproduce this situation, you need to switch on the “Readable line length” option.
If you fold every three sections and place the cursor on the very top, you move the cursor with the j button and the sections that did not fit in one line are going to be unfolded. Same situation if you start from the bottom and go up with the cursor using the vim-mode button k.
So the first section is not unfolded as it fits in one line. The second section is only unfolded if the cursor is at the very beginning (because then is does not fit in one line). The third section is unfolded every time because it does not fit in one line.
There will be some fixes for the issues reported in this thread in 1.5.4.
If you still have problems please open a new bug report and be specific about your problem with repro steps. Also make sure if it’s something that happens only when vim is enabled.