-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Treat folds the same as normal lines for cursor movement #25097
Comments
@calebmeyer This works as you describe out-of-the-box (i.e. with the vim extension disabled). I can only recommend that you create an issue on the vim extension. They could perhaps implement more of their motions by invoking core editor commands, in this case for |
Turns out there is already an issue: VSCodeVim/Vim#1004 |
The issue we have in VSCodeVim is that we want to move by "line", normally, but we also don't want to open up folds automatically. Doing move with "line" satisfies the first part, while doing move with "wrappedLine" satisfies the second part. Is there some solution I'm unaware of that allows us to have the desired behaviors of both? |
The solution atom and unmodified vs code uses (which works fine for me), is to treat movement by visible line instead of by actual line. Thus moving down on a fold jumps to the end of the fold instead of the next line (which is inside the fold). I'd argue (from a vim standpoint) that the motion is more useful if it treats the entire fold as one line. Thus @Chillee can you explain why you would want to move by "line" for folds? Edit: Just checked actual vim, movements treat folds as a single line there. |
The issue isn't that I want to move by "line" for folds, it's that moving by "line" automatically expands the fold. |
The bug I'm experiencing has two parts:
j
in normal mode, or keyboard down arrow in insert mode), the cursor is moved to the end of the line (the fold marker) for lines which have a fold.Steps to Reproduce
Expected Result
The cursor treats folded lines as it treats any other lines (you can move up, down over a folded group as though they were all a single line)
Here's the expected behavior, in atom (I apologize for my poor gif quality):
Actual Result
Hitting down moves the cursor to the end of the line, atop the fold indicator.
The fold expands.
Here's the actual behavior, in VS Code:
Notes
I'm using the vim extension in VS Code and vim-mode-plus in Atom. In both cases, it doesn't matter whether I use
j
ordown arrow
.I'd love to see a setting to disable the auto fold expansion, assuming it's working as designed. I'd much rather toggle the fold myself with a keybinding.
I'd also love to see a toggle fold command. It appears VS Code only has expand and collapse commands.
The text was updated successfully, but these errors were encountered: