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

RStudio Keymap shortcuts are visible even with keymap disabled #3993

Open
jmcphers opened this issue Jul 12, 2024 · 1 comment
Open

RStudio Keymap shortcuts are visible even with keymap disabled #3993

jmcphers opened this issue Jul 12, 2024 · 1 comment
Labels
area: core Issues related to Core category. bug Something isn't working support

Comments

@jmcphers
Copy link
Collaborator

jmcphers commented Jul 12, 2024

The RStudio Keymap shortcuts are visible all the time, even with the keymap disabled. They wind up in menus (see #3847), and are also visible in the key mappings dialog.

image

This happens because the RStudio Keymap extension registers its shortcuts declaratively, as part of the extension's package JSON.

"keybindings": [
{
"mac": "cmd+shift+n",
"win": "ctrl+shift+n",
"linux": "ctrl+shift+n",
"key": "ctrl+shift+n",
"when": "config.rstudio.keymap.enable",
"command": "r.createNewFile"
},

This is the established pattern for keymaps extensions in the ecosystem.

image

However, because the RStudio Keymap is a built-in extension, it is always installed and always activated. In order to prevent the keymap from also always being active, we guard each mapping with config.rstudio.keymap.enable, so it only engages when the "RStudio Keymap" setting is on.

image

This doesn't provide a clean experience; we need to prevent these keymappings from leaking when the keymap is disabled.

Options:

@lijiaqi-github
Copy link

lijiaqi-github commented Nov 22, 2024

I enable the RStudio Keymap shortcuts. I 'm not sure if it's my settings that are wrong, ctrl+ shift + A doesn't work.

Also, alt + "-" on the numeric keypad doesn't work (<-). But alt + "-" on the right side of the number 0 on the main keyboard (the third key to the left of backspace) can output <- normally.

Others like ctrl + 1 or ctrl + shift + n can be used.

I'm not sure if it's a bug, I'm more suspicious that I have set it wrong. Can you help me? Thank you very much.

This is the version information:

Positron Version: 2024.12.0 (system setup) build 41
Code - OSS Version: 1.93.0
Commit: 39536c2
Date: 2024-11-18T02:47:00.983Z
Electron: 30.4.0
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631

This is my keybindings.json (no setting):

[
]

This is my settings.json:

{
"workbench.colorTheme": "Default Positron Dark",
"quarto.visualEditor.spelling": true,
"js/ts.implicitProjectConfig.checkJs": true,
"python.analysis.diagnosticMode": "workspace",
"git.confirmSync": false,
"explorer.confirmDelete": false,
"problems.defaultViewMode": "table",
"problems.showCurrentInStatus": true,
"editor.autoClosingBrackets": "beforeWhitespace",
"editor.autoClosingDelete": "never",
"positron.r.pipe": "%>%",
"editor.minimap.enabled": true,
"editor.minimap.maxColumn": 200,
"application.experimental.positronPlotsInEditorTab": true,
"rstudio.keymap.enable": true
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues related to Core category. bug Something isn't working support
Projects
None yet
Development

No branches or pull requests

3 participants