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

preserve margins when using Ctrl-O for newline #9770

Merged
merged 2 commits into from Jul 22, 2016
Merged

Conversation

@gforsyth
Copy link
Contributor

gforsyth commented Jul 16, 2016

This should address #9588. Control-O will insert a new
line, preserve the current cursor position and preserve the indentation
level on the newline

This should address #9588.  Control-O will insert a new
line, preserve the current cursor position and preserve the indentation
level on the newline
@gforsyth
Copy link
Contributor Author

gforsyth commented Jul 16, 2016

@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)

This comment has been minimized.

Copy link
@takluyver

takluyver Jul 16, 2016

Member

I guess that the filter probably needs to check for Emacs mode too.

@gforsyth
Copy link
Contributor Author

gforsyth commented Jul 17, 2016

@takluyver -- I think this is ready for another look. I removed the insert_mode filter since the emacs mode filter (I think) always overlaps with that.

@takluyver
Copy link
Member

takluyver commented Jul 17, 2016

Thanks. Yes, I think that works - EmacsInsertMode should be effectively emacs & insert.

@takluyver
Copy link
Member

takluyver commented Jul 19, 2016

@njsmith I have given this a quick test, but I'd like you to test that it actually behaves as you want.

@Carreau Carreau added this to the 5.1 milestone Jul 19, 2016
@Carreau
Copy link
Member

Carreau commented Jul 19, 2016

Marking as 5.1

@Carreau
Copy link
Member

Carreau commented Jul 22, 2016

Ok, looks good.

@Carreau Carreau merged commit 0c67401 into ipython:master Jul 22, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.