-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
preserve margins when using Ctrl-O for newline #9770
Conversation
This should address ipython#9588. Control-O will insert a new line, preserve the current cursor position and preserve the indentation level on the newline
@njsmith -- do you want to try this out and see if it meets your needs? |
@@ -56,6 +56,10 @@ def register_ipython_shortcuts(registry, shell): | |||
& cursor_in_leading_ws | |||
))(indent_buffer) | |||
|
|||
registry.add_binding(Keys.ControlO, | |||
filter=(HasFocus(DEFAULT_BUFFER) | |||
& insert_mode))(newline_with_copy_margin) |
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.
I guess that the filter probably needs to check for Emacs mode too.
@takluyver -- I think this is ready for another look. I removed the |
Thanks. Yes, I think that works - EmacsInsertMode should be effectively emacs & insert. |
@njsmith I have given this a quick test, but I'd like you to test that it actually behaves as you want. |
Marking as 5.1 |
Ok, looks good. |
This should address #9588. Control-O will insert a new
line, preserve the current cursor position and preserve the indentation
level on the newline