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

Conversation

Projects
None yet
3 participants
@gforsyth
Contributor

gforsyth commented Jul 16, 2016

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

preserve margins when using Ctrl-O for newline
This should address ipython/ipython#9588.  Control-O will insert a new
line, preserve the current cursor position and preserve the indentation
level on the newline
@gforsyth

This comment has been minimized.

Show comment
Hide comment
@gforsyth

gforsyth Jul 16, 2016

Contributor

@njsmith -- do you want to try this out and see if it meets your needs?

Contributor

gforsyth commented Jul 16, 2016

@njsmith -- do you want to try this out and see if it meets your needs?

Show outdated Hide outdated IPython/terminal/shortcuts.py
@@ -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.

@takluyver

takluyver Jul 16, 2016

Member

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

@takluyver

takluyver Jul 16, 2016

Member

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

@gforsyth

This comment has been minimized.

Show comment
Hide comment
@gforsyth

gforsyth Jul 17, 2016

Contributor

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

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Jul 17, 2016

Member

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

Member

takluyver commented Jul 17, 2016

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

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Jul 19, 2016

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@Carreau

Carreau Jul 19, 2016

Member

Marking as 5.1

Member

Carreau commented Jul 19, 2016

Marking as 5.1

@Carreau

This comment has been minimized.

Show comment
Hide comment
@Carreau

Carreau Jul 22, 2016

Member

Ok, looks good.

Member

Carreau commented Jul 22, 2016

Ok, looks good.

@Carreau Carreau merged commit 0c67401 into ipython:master Jul 22, 2016

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