-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Implement Window/Page scroll commands #9609
Comments
About the first task, just realized that we have Users are allowed to scroll line up or down with numeric prefix, like 10 Ctrl-E to scroll ten lines down. If we repeat |
@rebornix Delivered a new command called |
@sandy081 I just ran your commands but see below errors
any idea? |
@rebornix Hmm strange, I do not see any issue while using this command in our sample Vim extension. Can you show me how are you calling this command? |
@sandy081 I just simply called |
Finally I saw the problem. I'm not using the value of The only problem left is scrolling down the window I guess you disable scrolling downwards the window on the first line as this command is not cursor moving and if we allow this command on the first line, the cursor will be out of current viewport, right? However Vim's behavior on this is scrolling lines/pages without moving cursor, if the final viewport doesn't contain the original line, Vim will put the cursor on the beginning of the nearest visible line in viewport. |
@rebornix editorScroll command does not disable any scrolling in the above scenario. It just scrolls the window up or down irrespective of the cursor position. It does not reposition the cursor if it goes outside view port. I think this is beyond the scope of command's functionality. |
@sandy081 that's what I'm seeing, now I reposition the cursor in VSCodeVim's code and it works well. The only issue I see is scrolling doesn't work on first line, can you help confirm? |
@rebornix Enhanced Also implemented |
@sandy081 Played with BTW, I'm checking the result of this command by setting breakpoint before and after this line, so there should be other side effect by VSCodeVim. |
@rebornix Yeah, please check if there is some side effect from Vim extension, because this was working properly in the sample. |
Great, where do i write this config? |
These commands are needed for Vim:
From VSCodeVim/Vim#210:
Vim has handy commands for scrolling without moving the cursor, e.g. zt, which scrolls the screen so that the line with the current cursor is placed as the first line. E.g., I often do actions like /main(zt, so that I can see as much of the main function as possible.
Would it be possible to implement zt, zb and zz?
Thanks!
'to'
'by'
'revealCursor'
true
reveals the cursor while scrolling otherwise does not.'at'
Horizontal scrolling is already implemented by cursor move commands. Hence marking this done. See VIM API Gaps #8997
The text was updated successfully, but these errors were encountered: