posit-dev / posit-dev/positron

Cursor jumping to start of chunk in visual mode quarto after switching back from a different window

Open
#4,248 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: quarto enhancement support
Dominant language
TypeScript
Stars
4.3k
Forks
184
Avg merge
1d 9h
Merged PRs (30d)
195

Description

System details: Windows 11

Positron and OS details:

Positron Version: 2024.07.0 (system setup) build 2024.07.0-125
Code - OSS Version: 1.91.0
Commit: cae4905332a0f41a6233e196b48a6679b832000a
Date: 2024-07-31T22:26:02.970Z
Electron: 29.4.0
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.22631

Interpreter details:

R 4.2.2

Describe the issue:

The cursor jumps to the start of code chunk in visual mode of Quarto after switching back from another screen/window. The problem is also reported under the Quarto repository ( https://github.com/quarto-dev/quarto/issues/340). A video is provided there.

However, it was explained by jjallaire there that it is a VS Code issue and cannot be fixed on their part. I hope the positron team can fix this issue as you can deal directly with the internal code.

Steps to reproduce the issue:

  1. Start a quarto document
  2. Switch to visual mode
  3. Start a code chunk (R/Python/Latex...)
  4. Input some random code and click somewhere random in the code chunk so the cursor is not at the beginning
  5. Switch to another window/screen (e.g. with Alt+Tab in Windows)
  6. Switch back to Quarto
  7. Cursor is at the start of the chunk

Expected or desired behavior:

When switching back from another window, the cursor remains where it was

Were there any error messages in the UI, Output panel, or Developer Tools console?

No

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in a Quarto document using visual mode, a code chunk, and a second window, following the listed Windows steps. Compare the behavior with the linked Quarto issue and verify that returning to Positron preserves the cursor position rather than moving it to the chunk start.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex, python, r
Domain
desktop, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.