View does not scroll when I jump to top-of-file with :0
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Describe the bug
I use :[line-number] to move around. :0 in vi typically jumps to top-of-file line 1. In Vscode vim the cursor jumps to line 1 but the view does not change. When I take an action that moves the cursor hjkl, THEN the view jumps to top-of-file.
To Reproduce
Steps to reproduce the behavior:
1 - open a long code file (longer than the screen)
2- go down far enough to scroll the top lines off the screen. Bottom-of-file is fine
3 - :0 to jump to top-of-file, observe the cursor is disappeared (jumped to line 1) but view does not jump
5 - i for insert mode, observe the view does not jump
6 - move the cursor by typing hello, observe the view jumps to top-of-file
Expected behavior
:0 moves the cursor and the view to top-of-file
Screenshots
I can demonstrate on a short video if necessary
Environment (please complete the following information):
- Extension (VsCodeVim) version: 1.25.2
- VSCode version:1.81.1
- OS:darwin x64 22.6.0
Additional context
pasting settings
{
"editor.cursorStyle": "block",
"vim.commandLineModeKeyBindings": [],
"[python]": {
"editor.formatOnType": true
},
"python.terminal.activateEnvInCurrentTerminal": true,
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.env.osx": {},
"terminal.integrated.scrollback": 10000,
"git.autofetch": true,
"editor.smoothScrolling": true,
"editor.cursorSmoothCaretAnimation": "on",
"editor.cursorSurroundingLines": 10,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"workbench.list.scrollByPage": true,
"workbench.list.smoothScrolling": true,
"workbench.localHistory.maxFileEntries": 500,
"workbench.startupEditor": "none",
"workbench.fontAliasing": "antialiased",
"cmake.configureOnOpen": false,
"workbench.editor.highlightModifiedTabs": true,
"workbench.editor.tabCloseButton": "left",
"window.clickThroughInactive": false,
"update.showReleaseNotes": false,
"telemetry.telemetryLevel": "off",
"editor.minimap.renderCharacters": false,
"editor.minimap.enabled": false,
"editor.folding": false,
"terminal.integrated.copyOnSelection": true,
"terminal.integrated.macOptionClickForcesSelection": true,
"terminal.integrated.shellIntegration.suggestEnabled": true,
"terminal.integrated.tabStopWidth": 4,
"terminal.integrated.tabs.showActions": "always",
"git.confirmSync": false,
"makefile.makefilePath": "Makefile",
"python.linting.mypyArgs": [
"--follow-imports=silent",
"--ignore-missing-imports",
"--show-column-numbers",
"--no-pretty",
"--strict",
"--implicit-reexport"
],
"gitlens.plusFeatures.enabled": false,
"gitlens.remotes": [
{"domain":"XXXXX", "type":"GitLab"}
],
"gitlens.partners": {},
"gitlens.telemetry.enabled": false,
"python.linting.flake8Args": [
"--max-line-length=132"
],
"flake8.args": [
"--max-line-length=132"
],
"terminal.integrated.enableMultiLinePasteWarning": false,
"window.zoomLevel": 2,
"workbench.colorTheme": "Default High Contrast",
"vim.cursorStylePerMode.insert": "block",
"vim.cursorStylePerMode.normal": "block-outline",
"vim.cursorStylePerMode.replace": "block",
"vim.incsearch": false,
"editor.guides.indentation": false
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with a long file by using :0 after scrolling away from the top. Trace the :[line-number] command handling and compare the view update for :0 with a cursor move; done means the view reaches the top immediately after :0, including when entering insert mode. No source file or test is named in the report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100