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

Issue Tracker: Sync viewport scroll #1261

Open
4 of 8 tasks
theol0403 opened this issue Jul 4, 2023 · 4 comments · May be fixed by #1335
Open
4 of 8 tasks

Issue Tracker: Sync viewport scroll #1261

theol0403 opened this issue Jul 4, 2023 · 4 comments · May be fixed by #1335
Assignees
Labels
category: sync synchronization between vscode and nvim (text, windows, etc) manager: viewport priority

Comments

@theol0403 theol0403 added category: sync synchronization between vscode and nvim (text, windows, etc) priority labels Jul 4, 2023
@theol0403 theol0403 self-assigned this Jul 4, 2023
@theol0403 theol0403 changed the title Issue Topic: Fix scrolling synchronisation Issue Topic: Scroll sync Jul 4, 2023
@theol0403 theol0403 changed the title Issue Topic: Scroll sync Issue Tracker: Scroll sync Jul 4, 2023
@theol0403 theol0403 changed the title Issue Tracker: Scroll sync Issue Tracker: Sync viewport scroll Jul 5, 2023
@theol0403 theol0403 linked a pull request Sep 4, 2023 that will close this issue
ian-h-chamberlain added a commit to ian-h-chamberlain/vscode-neovim that referenced this issue Sep 11, 2023
We already set the selection based on the neovim cursor from the
external buffer, but we should also scroll so that it's visible. This might
be better fixed with proper syncing like vscode-neovim#1261 but for now it makes :help work
a lot nicer.
ian-h-chamberlain added a commit to ian-h-chamberlain/vscode-neovim that referenced this issue Sep 11, 2023
We already set the selection based on the neovim cursor from the
external buffer, but we should also scroll so that it's visible. This might
be better fixed with proper syncing like vscode-neovim#1261 but for now it makes :help work
a lot nicer.
ian-h-chamberlain added a commit to ian-h-chamberlain/vscode-neovim that referenced this issue Sep 12, 2023
We already set the selection based on the neovim cursor from the
external buffer, but we should also scroll so that it's visible. This might
be better fixed with proper syncing like vscode-neovim#1261 but for now it makes :help work
a lot nicer.
theol0403 pushed a commit that referenced this issue Sep 18, 2023
* feat(buffer): add external buffer doc provider

This opens a document with a proper buffer name and matches it to the
appropriate neovim external buffer.

The document is "readonly" as far as VSCode is concerned, but it can
still be edited by setting `modifiable`, so we still need to sync
buffer changes whenever it updates. This can break highlighting, however.

* fix(buffer): scroll to selection on buffer open

We already set the selection based on the neovim cursor from the
external buffer, but we should also scroll so that it's visible. This might
be better fixed with proper syncing like #1261 but for now it makes :help work
a lot nicer.

* refactor(buffer): improve logs, change URI scheme

* fix(buffer): escape external buffer name on Windows

Building a vscode.Uri throws an exception if the `path` component
doesn't match a certain expected format, which Windows file paths do
not. Uri.file() properly escapes/converts file paths as needed.

* fix(test): end nvim client connection gracefully

Instead of forcefully destroying the client connection, it's nicer to
let it end with FIN first, allowing the server to gracefully close. This
prevents a lot of noisy errors that make it hard to read test output.

* fix(buffer): notify doc change after buffer event

Ensure we notify for document change after other buffer event
processing. Enforcing order like this  seems to help with asynchronous
ordering / timing issues on Windows.

* fix(buffer): catch error on external buffer open
@mikkelsvartveit
Copy link

mikkelsvartveit commented Dec 13, 2023

Anything new here? This is driving me crazy as I use <C-u> and <C-d> a lot.

@xiyaowong
Copy link
Collaborator

@mikkelsvartveit C-d doesn't work?

@mikkelsvartveit
Copy link

@xiyaowong It works, but it does not behave in the same way as (neo)vim. What happens in real Vim is that the cursor moves down, but the window also scrolls accordingly, resulting in the cursor staying in the same position on the screen. In vscode-neovim, it just moves the cursor down half a page but doesn't scroll the viewport.

@tom-pollak
Copy link

#983 has workarounds for viewpoint scroll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: sync synchronization between vscode and nvim (text, windows, etc) manager: viewport priority
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

4 participants