Skip to content

Commit

Permalink
Merge pull request #2745 from gnestor/keymap-default
Browse files Browse the repository at this point in the history
Make "extraKeys" consistent for notebook and editor
  • Loading branch information
takluyver authored Sep 20, 2017
2 parents 39c27ac + f222978 commit 11ba6be
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
12 changes: 9 additions & 3 deletions notebook/static/edit/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,18 @@ function(
// default CodeMirror options
Editor.default_codemirror_options = {
extraKeys: {
"Tab" : "indentMore",
"Cmd-Right": "goLineRight",
"End": "goLineRight",
"Cmd-Left": "goLineLeft",
"Tab": "indentMore",
"Shift-Tab" : "indentLess",
"Cmd-/" : "toggleComment",
"Ctrl-/" : "toggleComment",
},
indentUnit: 4,
theme: "ipython",
lineNumbers: true,
lineWrapping: true,
lineWrapping: true
};

Editor.prototype.load = function() {
Expand Down Expand Up @@ -170,7 +176,7 @@ function(
Editor: {
file_extension_modes: update_mode_map,
}
})
});
};

Editor.prototype.get_filename = function () {
Expand Down
2 changes: 1 addition & 1 deletion notebook/static/edit/js/menubar.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ define([
});

this.events.on("config_changed.Editor", function () {
var keyMap = editor.codemirror.getOption('keyMap') || "default";
var keyMap = editor.codemirror.getOption('keyMap') || 'default';
that.element.find(".selected-keymap").removeClass("selected-keymap");
that.element.find("#menu-keymap-" + keyMap).addClass("selected-keymap");
});
Expand Down
2 changes: 0 additions & 2 deletions notebook/static/notebook/js/cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ define([
"Cmd-Left": "goLineLeft",
"Tab": "indentMore",
"Shift-Tab" : "indentLess",
// "Cmd-Alt-[" : "indentAuto",
// "Ctrl-Alt-[" : "indentAuto",
"Cmd-/" : "toggleComment",
"Ctrl-/" : "toggleComment",
}
Expand Down

0 comments on commit 11ba6be

Please sign in to comment.