Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ec1693c

Browse files
authored
Merge pull request #14830 from tacaswell/fix_restore_nbagg_cell_advance
FIX: restore special casing of shift-enter in notebook
2 parents e6c1ff1 + a910afb commit ec1693c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/matplotlib/backends/web_backend/js/nbagg_mpl.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,9 @@ mpl.figure.prototype._key_event_extra = function(event, name) {
166166
// Check for shift+enter
167167
if (event.shiftKey && event.which == 13) {
168168
this.canvas_div.blur();
169-
event.shiftKey = false;
170-
// Send a "J" for go to next cell
171-
event.which = 74;
172-
event.keyCode = 74;
173-
manager.command_mode();
174-
manager.handle_keydown(event);
169+
// select the cell after this one
170+
var index = IPython.notebook.find_cell_index(this.cell_info[0]);
171+
IPython.notebook.select(index + 1);
175172
}
176173
}
177174

0 commit comments

Comments
 (0)