-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PR: Add Ctrl+Shift+Enter to enter a new line in the Editor #6423
Conversation
Many editors offer the possibility to create new lines without breaking that one the cursor is currently in. This is very handy for people using autocompletition for brackets for example.
Hello @Sarbot! Thanks for updating the PR.
Comment last updated on February 10, 2018 at 13:56 Hours UTC |
to pass the codestyle check
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.
Can you write a simple unit test for this behavior? Also, can you make the shortcut configurable? I currently use Shift-Ctrl-Enter for run cell, as I'm not a fan of the defaults.
I'll try to do that in the next days. |
To include this as shortcut instead of hard coding the keybinding, I guess it needs to be included in the
I found a definition in base.py is that the place where I can define a new function? |
Yes that's exactly what it does, but I still need to fix the auto indent after the line break.
But I'm not sure if/how I could apply this indentation to the new function in
Appart from this the latest commit is working for me, the keybinding can be changed in settings. |
Great job so far @Sarbot! The only thing missing is a test, as @CAM-Gerlach pointed out. Don't worry about the failing test, it's unrelated to your work. |
I don't know, probably. Could you test it locally and report back? |
Nvm @ccordoba12 , he added the configurable shortcut—my bad, didn't see that when I was writing my original comment. Thanks @Sarbot ! I'll test it anyway just to make sure. |
Okay, tested it out. Starting out, neither function works; Ctrl-Shift-Enter does nothing. However, after I go to prefs, where I'm warned about the conflicting shortcut, and change it to something unique, this function works just fine as expected (and so does run cell). Thanks! |
Is |
BTW, if you
@Sarbot Nope, its not a default, though it is for Rstudio (and possibly others) which we plan to implement as a built-in hotkey preset in the upcoming Spyder 4. Once it is reset to something unique (which is possible thanks to you setting up the configurable shortcut), everything works perfectly, though if other users employ it, it could cause some confusion at first However, this is really more of a broader UX question of whether and how to better handle shortcuts that are added in a new release that conflict with existing added ones, and isn't really the fault of this PR at all. Thanks for checking!
It shouldn't be too tough especially since we're using |
This is nice and a test for it seems too much of a burden. Let's merge it and see how it goes. |
Fixes #5466
A keybind to start a new line without breaking the current (bevore it ends) is included in many editors. This is very handy for people using autocompletition for brackets