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

Support Alt+Enter Keyboard Shortcut #2778

Open
jaredlander opened this issue Apr 12, 2024 · 5 comments
Open

Support Alt+Enter Keyboard Shortcut #2778

jaredlander opened this issue Apr 12, 2024 · 5 comments
Labels
area: console Issues related to Console category. enhancement New feature or request
Milestone

Comments

@jaredlander
Copy link

Positron Version:

Positron Version: 2024.03.0 (system setup) build 2024.03.0-6584
Code - OSS Version: 1.87.0
Commit: fe73a9a
Date: 2024-04-01T03:18:17.396Z
Electron: 27.3.2
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Windows_NT x64 10.0.22631

Steps to reproduce the issue:

  1. Put cursor on a line of code
  2. Press Alt+Enter

What did you expect to happen?

In RStudio this sends a line of code without the cursor moving to the next line (as Ctrl+Enter does). In Positron, nothing happened.

I'm sure I can edit the shortcuts myself, but since this is built in to RStudio I think users would expect it to be here as well.

Were there any error messages in the output or Developer Tools console?

None

@jaredlander jaredlander added the bug Something isn't working label Apr 12, 2024
@DavisVaughan DavisVaughan changed the title Support Alt+Tab Keyboard Shortcut Support Alt+Enter Keyboard Shortcut Apr 12, 2024
@juliasilge juliasilge added enhancement New feature or request and removed bug Something isn't working labels Apr 16, 2024
@juliasilge
Copy link
Contributor

As of today, we don't expose a way to control whether the cursor moves to the next line or not while executing code, so this isn't something that you can set up your own keybinding for right now. I will move this to our main repo as a feature request.

Thanks for the feedback! 🙌

@juliasilge juliasilge transferred this issue from another repository Apr 16, 2024
@juliasilge
Copy link
Contributor

In registerPositronConsoleActions() we create the action for executing code:

That action does a lot of work to move to the appropriate next line of code, but we could break that action up into two pieces, one of which is just executing the current statement and not computing newPosition. We can then bind that to Alt+Enter.

@juliasilge juliasilge added the area: console Issues related to Console category. label Apr 16, 2024
@juliasilge juliasilge added this to the Future milestone Apr 16, 2024
@EKtheSage

This comment was marked as off-topic.

@juliasilge

This comment was marked as off-topic.

@Btibert3
Copy link

Btibert3 commented Sep 19, 2024

I recently asked this question and was directed to this chain so adding my +1 here as a feature request. The ability to jump ahead is fantastic, but there are situations where its favorable to run the current line and keep focus. My use case is for my class discussions where we write code together to learn.

Currently, I provide students with a templated script that we will use in class, and when its not a great experience to always skip to the end of the script and have to scroll back, especially for students learning to code.

The workaround at the moment is to select the snippets to run and use Command+ return (on a Mac). I will coach around it for now but it would be nice to have control on how code execution behaves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: console Issues related to Console category. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants