Skip to content

Loading…

Keyboard selection of multiple lines in the notebook behaves inconsistently #787

Closed
khinsen opened this Issue · 5 comments

4 participants

@khinsen

When selecting multiple lines in a notebook cell using SHIFT+Cursor down, the cursor moves to the next cell before selecting the last line of the current cell.

Expected behaviour: I'd expect editing to be limited to one cell, so the cursor should never leave when SHIFT is pressed. This is the case for moving left and right, but not up and down.

Tested using Chrome 13.0.782.220 under MacOS 10.5.

@fperez
IPython: interactive computing in Python member

Yes, I've noticed the same and it's indeed quite annoying. Thanks for opening the issue. @ellisonbg, do you think this is easy to fix with CodeMirror or not? Konrad, just to fill you in: we use a little in-cell editor widget called CodeMirror, so some of these issues actually come from CodeMirror and we need to figure out if we can work around them or if we need them to be fixed in codemirror itself...

@ellisonbg
IPython: interactive computing in Python member

Not sure I will have to look into it.

@takluyver
IPython: interactive computing in Python member

I think the culprit is these lines in notebook.js: https://github.com/ipython/ipython/blob/master/IPython/frontend/html/notebook/static/js/notebook.js#L59

It looks like we're catching up/down to let us move to the next cell, but we're not checking anywhere if shift is in use with the key event.

@fperez
IPython: interactive computing in Python member

@takluyver, if you could have a shot at this one it would be great. It's not a huge deal but actually quite annoying in practice when editing a lot.

@takluyver
IPython: interactive computing in Python member

Closed by PR #1038: auto-close appears not to be working.

@takluyver takluyver closed this
@stefanv stefanv pushed a commit to stefanv/ipython that referenced this issue
@takluyver takluyver Notebook: don't change cell when selecting code using shift+up/down.
Closes gh-787; closes gh-1038 (rebased to prevent recursive merge).
807f914
@fperez fperez referenced this issue
Commit has since been removed from the repository and is no longer available.
@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue
@takluyver takluyver Notebook: don't change cell when selecting code using shift+up/down.
Closes gh-787; closes gh-1038 (rebased to prevent recursive merge).
7c19a22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.