quarto-dev / quarto-dev/quarto

Keyboard shortcut for "Toggle Line Comment" (Cmd+/) does not work inside code chunks in Visual Mode

Open
#987 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug visual-editor
Dominant language
TypeScript
Stars
645
Forks
62
Avg merge
17h 42m
Merged PRs (30d)
13

Description

Bug description

In Positron, when working in Visual Mode within a .qmd or .Rmd file, the keyboard shortcut for toggling line comments (Cmd + / on macOS or Ctrl + / on Windows) does not work when the cursor is inside a code chunk (e.g., {python} or {r}).

However, it works perfectly fine when switching back to Source Mode.

In RStudio, the comment shortcut works seamlessly inside code chunks even in Visual Mode. As an RStudio user migrating to Positron, this feels like a slight regression in the user experience. It would be highly appreciated if the Visual Editor could pass the comment shortcut down to the underlying code cell.

Steps to reproduce
Open a .qmd or .Rmd document in Positron.
Switch to Visual Mode.
Insert or find a code chunk (e.g., {python}).
Place the cursor on a line of code inside the chunk.
Press Cmd + / (macOS) or Ctrl + / (Windows).
Expected behavior
The current line of code inside the chunk should be commented out (e.g., adding # at the beginning of the line), just like it does in RStudio's Visual Mode or Positron's Source Mode.

Actual behavior
Nothing happens. The shortcut seems to be intercepted or ignored by the Visual Editor.

Environment
OS: macOS (or Windows, please specify)
Positron Version: (You can find this in Positron menu -> About Positron)

Steps to reproduce

No response

Actual behavior

No response

Expected behavior

No response

Your environment

No response

Contributor guide

No contributing guide indexed for this repository

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

No files or tests are named in the issue. Start by locating the Visual Mode keyboard-shortcut handling and how code chunks connect to the underlying editor, then reproduce the Cmd+/ and Ctrl+/ cases in a .qmd or .Rmd file. Done means the current line inside a code chunk is commented in Visual Mode on macOS and Windows, with regression coverage for the shortcut.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.