Skip to content
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

It is possible to scroll the cursor out of screen #3846

Closed
juanlanus opened this issue Jun 20, 2019 · 3 comments
Closed

It is possible to scroll the cursor out of screen #3846

juanlanus opened this issue Jun 20, 2019 · 3 comments

Comments

@juanlanus
Copy link

juanlanus commented Jun 20, 2019

Describe the bug
Unlike with vi and vim, with vscodevim it is possible to scroll the insertion point out of the screen.
As vim comes from vi which was a terminal text editor, the cursor was always "there".
GUIs allow the cursor to go out of sight, but IMO this is not a Good Thing.

To Reproduce

  1. Open a file with more lines that the viewport height
  2. Click on one of the first lines
  3. Scroll down, more than one page
  4. Notice that the insertion point is not visible.
  5. Type a space and see how the text scrolls in an unexpected fashion.

Expected behavior
1- When scrolling down the cursor stays in the line it was initially, same column (as now)
2- When the line that contains the cursor reaches the top of the screen, the cursor stays in that top line
3- When scrolling back a few lines the cursor stays in the line it is as it moves down
4- With back scroll the behavior is symmetric
5- Scrolling does not change the column the cursor "wants" to be

Screenshots
If applicable, add screenshots to help explain your problem.
If remapping-related, please attach log output: https://github.com/VSCodeVim/Vim#debugging-remappings.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.8.1 with neovim enabled
  • VSCode version: Version: 1.35.1
    Commit: c7d83e57cd18f18026a8162d042843bda1bcf21f
    Date: 2019-06-12T14:27:31.086Z
    Electron: 3.1.8
    Chrome: 66.0.3359.181
    Node.js: 10.2.0
    V8: 6.6.346.32
    OS: Linux x64 5.0.0-16-generic
  • OS:

Additional context
Vim always has an integer number of lines, and it's not possible to scroll a line partially.
I bring this up here because it might be related to this bug.
These are ingredients of the Full Vim Experience.

@trusktr
Copy link

trusktr commented Jul 8, 2019

Hello @juanlanus, this is a Vim emulator. The way the VS Code editor works is completely different than actual Vim. The cursor does not stay in view when you scroll, like it does in Vim. That is a Vim-only feature.

It is certainly possible to implement such emulation, though I expect this doesn't bug most people enough for them to make the contribution. If you implemented, that would be cool!

I my self actually like my cursor staying exactly where is in the text file while I scroll. This makes it easy to jump right back to that same spot by moving the cursor by one character. I never liked the feature of Vim that keeps the cursor in view, and I actually like that emulators allow us to scroll without losing our position.

@J-Fields
Copy link
Member

This has been discussed before; see #873.

J-Fields added a commit that referenced this issue Sep 8, 2019
This setting emulates vim's limitation (or feature, depending on how you look at it) which kept the cursor within the viewport, even when scrolling with the mouse.
Fixes #873, #3846
@J-Fields
Copy link
Member

Closing in favor of #873

J-Fields added a commit that referenced this issue Sep 28, 2019
This setting emulates vim's limitation (or feature, depending on how you look at it) which kept the cursor within the viewport, even when scrolling with the mouse.
Fixes #873, #3846
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants