Skip to content
This repository

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

Closed
khinsen opened this Issue September 13, 2011 · 5 comments

4 participants

khinsen Thomas Kluyver Fernando Perez Brian E. Granger
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.

Fernando Perez
Owner

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

Brian E. Granger
Owner

Not sure I will have to look into it.

Thomas Kluyver
Collaborator

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.

Fernando Perez
Owner

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

Thomas Kluyver takluyver closed this November 24, 2011
Thomas Kluyver
Collaborator

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

Stefan van der Walt stefanv referenced this issue from a commit in stefanv/ipython November 24, 2011
Thomas Kluyver Notebook: don't change cell when selecting code using shift+up/down.
Closes gh-787; closes gh-1038 (rebased to prevent recursive merge).
807f914
Fernando Perez fperez referenced this issue from a commit January 10, 2012
Commit has since been removed from the repository and is no longer available.
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.