-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Desktop: Resolves #9980: Support Ctrl+Enter keyboard shortcut (Cmd+Enter on MacOS) #10003
Desktop: Resolves #9980: Support Ctrl+Enter keyboard shortcut (Cmd+Enter on MacOS) #10003
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
While this fixes the issue in the legacy CodeMirror 5-based markdown editor, the issue is still present in the CodeMirror 6-based editor. To make this work, I suspect that additional command declarations will have to be added here:
Alternatively, to also support mobile, the beta editor keyboard shortcuts could be added here:
Thank you for working on this! |
Thank you for the help. I've added the necessary shortcut to joplin/packages/editor/CodeMirror/createEditor.ts. Now works for both the editors. |
@@ -261,6 +261,7 @@ const createEditor = ( | |||
}), | |||
keyCommand('Tab', insertOrIncreaseIndent, true), | |||
keyCommand('Shift-Tab', decreaseIndent, true), | |||
keyCommand('Mod-Enter', insertBlankLine, true), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using insertLineAfter
from editorCommands/insertLineAfter.ts
here. insertLineAfter
should handle list continuation and auto-indentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. Made the necessary changes.
@PackElend label me please Link to introduction - https://discourse.joplinapp.org/t/introducing-marlsen/36358 |
Fixes #9980 by adding key bindings for Ctrl+Enter on Windows/Linux and Cmd+Enter on macOS. This adds functionality to add a new line after the line where the cursor currently is.
Testing
This has been tested successfully on Windows 11 and Ubuntu.
Test.mp4