Folded code unfolds if you spend some (unknown number) of ms idle in a fold
- Click thumbs-up 👍 on this issue if you want it!
- Click confused 😕 on this issue if not having it makes VSCodeVim unusable.
The VSCodeVim team prioritizes issues based on reaction count.
What did you do?
Scrolled through folded code once with the j key held down, another time pressing it over and over.
What did you expect to happen?
Folded lines were skipped.
What happened instead?
Cursor did not skip the folded lines (watch the line numbers in the gif).
Technical details:
- VSCode Version: 1.6.1
- VsCodeVim Version: 0.4.0
- OS: macOS Sierra (10.12)

This is annoying, but also hard. @aminroosta tried but had a bad time: https://github.com/VSCodeVim/Vim/pull/708
The problem as I understand it is that the only API VSCode allows us is "cursorMove" to move the cursor over folded lines, but we would actually like to know the position of the cursor as well (which "cursorMove" does not provide).
on ubuntu, i also suffer from this a log I found the solution using gg to jump to the last line
gg takes you to the first column on the first row, not the last line.
@Phrohdoh for example 25gg will take you to 25th line not the beginning i meant end of the block by last line
@NikosEfthias Oh I see, TIL. Thanks!
I can confirm this on VSCode 1.9.1 with Vim Plugin 0.5.3.
This makes working with larger, more complex files very unwieldy!
I've tried disabling the vim plugin and moving with the cursor keys. In that case it works as expected (folds remain closed).
+1 for this. Having my folds open while I'm navigating is quite frustrating. I find myself having to use my mouse to reposition my cursor, which should make all of us sad.
+1 for fixing this asap
+1 for this. It makes me very painful.
+1 comments aren't going to do anything but annoy the repo owners. Please use the 👍 reaction on the original post instead. Be kind to repo owners and other subscribed users.
Oops now I'm spamming (I didn't mean to close this).
:) It's okay. We generally use thumbs up as a measure of importance, but the extra signal we get from people who were so bothered they had to come and leave a comment is a little useful too. We're definitely aware this one is painful - we'll try to fix it as soon as we can!
Investigated this and realized it required some help from VSCode. Opened up an issue over there: https://github.com/Microsoft/vscode/issues/22276
Related: https://github.com/Microsoft/vscode/issues/25097
Glad to hear I'm not the first one to experience it.
sorry to say, but this makes the extension useless for me.
greetz...
I polished up my fix over here: https://github.com/VSCodeVim/Vim/pull/1552
It does some hackish stuff, but it seems to work great for me. Here's a pretty bad demo:

We just pushed out a new version, so enable vim.foldfix and tell us what you think!
It's a hack and not a proper solution to this problem, so we'll probably leave this issue open for now.
Has anybody tried out the new fix yet? Do you guys think it's workable as a proper fix (ie: this issue can be closed)?
I haven't tried it but you yourself said the implementation is a hack so IMO shouldn't be considered a proper fix. Am I misunderstanding?
Well, it is kinda hackish, but imo, if there's no difference for the user, then I would consider it a "proper fix".
For me, when I keep pressing j or k key, the cursor jumps sometimes to previous line (flickers) so I rather use gj/gk hack because in that case the cursor does not jump/flicker - only when I release the key, it keeps moving for couple of more lines.
@Chillee This is working great for me so far! I haven't noticed any issues with navigating over folds. So while the implementation may be "hackish", from a UX point of view I can't tell at all.
I would say "partially fixed". I can navigate over folds but if i initiate a fold from inside from anywhere but the top of of the folding block then it immediately unfolds. This is certainly better than before though. VSCode v1.12.2 Vim v0.8.4
Good catch, @zwing99! I'm seeing the same thing on my end, as well.
@skawaii @CendaL that's the type of feedback I was looking for.
The zc issue is a separate one: one that we didn't fix before because folds were practically unusable anyways imo.
@CendaL Yep that's currently an unavoidable consequence of this hack :(
@skawaii @zwing99 Could one of you open up a new issue to track this new bug?
@Chillee Sure. I created a ticket (#1803).
@skawaii @zwing99 I fixed the zc issue in the newest version.
@Chillee After the test, I found that 'zczc' didn't work on multiple fold levels.
@Chillee It looks good to me! Thanks for the fix!