Ctrl-D and Ctrl-U do not update cursor correctly
- 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?
Use Ctrl-D and Ctrl-U as movement keys. Also affects Ctrl-f and Ctrl-b.
What did you expect to happen?
The cursor should retain its relative position on the screen (disregard the edge of file case) during Ctrl-D and Ctrl-U movement.
What happened instead?
The cursor position is not updated within the file and drops off the visible portion of the screen. On the next successive movement there appears to be some check for an out of bounds cursor which places it to the bottom of the screen regardless of its initial position.
This makes movement with these keys unusable.
Technical details:
Pretty certain this a regression since VSCode 1.9 which did not have this problem. Doesn't appear to be any recent issues on VSCode itself relating to movement right now so not sure who the cause of this is.
- VSCode Version: 1.10
- VsCodeVim Version: 0.5.3
- OS: Arch Linux + Windows 10
Interesting - are you saying that this begun happening after the latest vscode release?
Until we solve this correctly, you can use the workaround found here https://github.com/VSCodeVim/Vim/issues/907#issuecomment-264738452 to redefine c-u and c-d. A lot of people rely on these motions, so we'll try to get there quickly!
Upgrading to Visual Studio Code Version 1.10.1 did not fix this for me on macOS.
@johnfn "Interesting - are you saying that this begun happening after the latest vscode release?"
Yes, this behavior just started with 1.10.1. I was using the Insiders release and noticed something funky but it didn't really hit me until I updated to 1.10.1 non-Insiders earlier today.
FWIW I have this problem on 1.10.0. I haven't yet restarted to update to 1.10.1.
I guess I should've mentioned I did not see the problem on 1.9.1. π
It sounds a lot like this is a regression in VSCode itself. I was able to confirm this by testing on 1.9.0, in which C-d and C-u worked correctly.
We've got our best men (aka @rebornix) on it. :)
It seems this problem is resolved in VSCode 1.10.2.
@johnfn I'm still not sure scrolling is working correctly. Ctrl-d, Ctrl-u, Ctrl-f, Ctrl-b do not scroll down like gvim.
With the cursor at the start of the document pressing Ctrl-f locates the cursor at the bottom of the screen. Pressing Ctrl-f a second time moves the current line to the top of the visual window.
Ctrl-f in gvim scrolls by one screen-height of text with each press. I'm currently using Windows 7 and haven't checked Windows 10 yet.
The fun part is setting below keybindings
{
"key": "ctrl+f",
"command": "editorScroll",
"when": "editorTextFocus",
"args": {
"to": "down",
"value": 1,
"by": "page",
"revealCursor": true
}
}
is perfect. However in Vim, we just call this command but the behavior is different. I'll take a look.
If you think ctrl-d and ctrl-u have gotten WORSE as compared to before this specific bug was introduced, please thumbs this specific comment up. (I don't use them at all, so I wouldn't know.)
We know they're still not really optimal. That is unfortunately a limit of vscode right now.
Can confirm on VSCode 1.11.2 with vscodevim 0.6.20; <C d> <C u> will move the cursor half a page down, which only moves the page down every other time I press it. π’This seems to be the same behavior @gwojan observed with <C f>.
Edit:
Also <C e> and <C y> don't scroll the page when the cursor is at an edge for me. ie when my cursor is at the first visible line, <C e> does nothing, and likewise when my cursor is at the bottom of the screen <C y> does nothing.
@snewell92 Is the <C-e> and <C-y> resolved for you now? It was reported somewhere else, and they reported that the most recent vscode release fixed that issue.
Yep! Can confirm resolution. Tyvm <3<3
I don't really get what the bug is here. I can't really replicate the exact bugs that most people are talking about with <c-d>.
I do have the issue where <c-d> moves the cursor to the top of the screen, but that seems like more this issue: https://github.com/VSCodeVim/Vim/issues/1348
@Chillee did you mean to reference another issue, you linked to this issue.
Originally @tiehuis said
The cursor should retain its relative position on the screen [when using
I was trying to generalize the problem to see if there was an underlying problem with how navigation movements worked, but that doesn't appear to be the case.
It seems to me that the this issue is now focused on the cursor position in <c-d> and <c-u>.
Oh I meant to link a different issue: https://github.com/VSCodeVim/Vim/issues/810
Stopped working with 1.15 but updated to 1.15.1 its working again.
This needs reopening.
I am finding this issue occur on certain files but not others. One html file that I have the behaviour described at the top of this post occurs, but on another html file works perfectly.
Intermittent issue but it is consistent with the file. Tried opening and closing VS Code closing the file and reopening.
Nothing really special about the file in question, just a html file with angularjs, it is 556 lines long if that is a factor. Copy pasted code into a new file, the new file had no issues. This is strange! Opening the file in split screen and the issue disappears with the file.
VS Code version: 1.15.1 vscodevim version: v0.10.0 windows 10
@boydy12 This issue doesn't seem to be closed to me?
I think it's a vscode limitation; hold off on that while I check though.
As a workaround you can define those bindings:
{
"before": ["<C-d>"],
"after": ["j","j","j","j","j","j","j","j"]
},
{
"before": ["<C-u>"],
"after": ["k","k","k","k","k","k","k","k"]
}
Looks weird, but works :)