Skip to content

Commit 11ba6be

Browse files
authored
Merge pull request #2745 from gnestor/keymap-default
Make "extraKeys" consistent for notebook and editor
2 parents 39c27ac + f222978 commit 11ba6be

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

notebook/static/edit/js/editor.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,18 @@ function(
7676
// default CodeMirror options
7777
Editor.default_codemirror_options = {
7878
extraKeys: {
79-
"Tab" : "indentMore",
79+
"Cmd-Right": "goLineRight",
80+
"End": "goLineRight",
81+
"Cmd-Left": "goLineLeft",
82+
"Tab": "indentMore",
83+
"Shift-Tab" : "indentLess",
84+
"Cmd-/" : "toggleComment",
85+
"Ctrl-/" : "toggleComment",
8086
},
8187
indentUnit: 4,
8288
theme: "ipython",
8389
lineNumbers: true,
84-
lineWrapping: true,
90+
lineWrapping: true
8591
};
8692

8793
Editor.prototype.load = function() {
@@ -170,7 +176,7 @@ function(
170176
Editor: {
171177
file_extension_modes: update_mode_map,
172178
}
173-
})
179+
});
174180
};
175181

176182
Editor.prototype.get_filename = function () {

notebook/static/edit/js/menubar.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ define([
125125
});
126126

127127
this.events.on("config_changed.Editor", function () {
128-
var keyMap = editor.codemirror.getOption('keyMap') || "default";
128+
var keyMap = editor.codemirror.getOption('keyMap') || 'default';
129129
that.element.find(".selected-keymap").removeClass("selected-keymap");
130130
that.element.find("#menu-keymap-" + keyMap).addClass("selected-keymap");
131131
});

notebook/static/notebook/js/cell.js

-2
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ define([
134134
"Cmd-Left": "goLineLeft",
135135
"Tab": "indentMore",
136136
"Shift-Tab" : "indentLess",
137-
// "Cmd-Alt-[" : "indentAuto",
138-
// "Ctrl-Alt-[" : "indentAuto",
139137
"Cmd-/" : "toggleComment",
140138
"Ctrl-/" : "toggleComment",
141139
}

0 commit comments

Comments
 (0)