##// END OF EJS Templates
CodeMirror shortcuts in QuickHelp...
Paul Ivanov -
Show More
@@ -1,9 +1,5 b''
1 //----------------------------------------------------------------------------
1 // Copyright (c) IPython Development Team.
2 // Copyright (C) 2008-2011 The IPython Development Team
2 // Distributed under the terms of the Modified BSD License.
3 //
4 // Distributed under the terms of the BSD License. The full license is in
5 // the file COPYING, distributed as part of this software.
6 //----------------------------------------------------------------------------
7
3
8 //============================================================================
4 //============================================================================
9 // QuickHelp button
5 // QuickHelp button
@@ -15,6 +11,34 b' var IPython = (function (IPython) {'
15 var QuickHelp = function (selector) {
11 var QuickHelp = function (selector) {
16 };
12 };
17
13
14 var cm_shortcuts = [
15 { shortcut:"Insert", help:"toggle overwrite" },
16 { shortcut:"Tab", help:"code completion" },
17 { shortcut:"Shift-Tab", help:"help introspection" },
18 { shortcut:"Cmd-]", help:"indent" },
19 { shortcut:"Cmd-[", help:"dedent" },
20 { shortcut:"Cmd-A", help:"select all" },
21 { shortcut:"Cmd-D", help:"delete line" },
22 { shortcut:"Cmd-Z", help:"undo" },
23 { shortcut:"Cmd-Shift-Z", help:"redo" },
24 { shortcut:"Cmd-Y", help:"redo" },
25 { shortcut:"Cmd-Up", help:"go to cell start" },
26 { shortcut:"Cmd-End", help:"go to cell start" },
27 { shortcut:"PageUp", help:"go to cell start" },
28 { shortcut:"---", help:"go to cell end" },
29 { shortcut:"Cmd-Down", help:"go to cell end" },
30 { shortcut:"PageDown", help:"go to cell end" },
31 { shortcut:"Alt-Left", help:"go one word left" },
32 { shortcut:"Alt-Right", help:"go one word right" },
33 { shortcut:"Cmd-Left", help:"go to line start" },
34 { shortcut:"Home", help:"go to line start" },
35 { shortcut:"Cmd-Right", help:"go to line end" },
36 { shortcut:"End", help:"go to line end" },
37 { shortcut:"Alt-Backspace", help:"del word before" },
38
39 ]
40
41
18 QuickHelp.prototype.show_keyboard_shortcuts = function () {
42 QuickHelp.prototype.show_keyboard_shortcuts = function () {
19 // toggles display of keyboard shortcut dialog
43 // toggles display of keyboard shortcut dialog
20 var that = this;
44 var that = this;
@@ -54,6 +78,10 b' var IPython = (function (IPython) {'
54 var edit_div = this.build_edit_help();
78 var edit_div = this.build_edit_help();
55 element.append(edit_div);
79 element.append(edit_div);
56
80
81 // CodeMirror shortcuts
82 var cm_div = build_div('', cm_shortcuts);
83 element.append(cm_div);
84
57 this.shortcut_dialog = IPython.dialog.modal({
85 this.shortcut_dialog = IPython.dialog.modal({
58 title : "Keyboard shortcuts",
86 title : "Keyboard shortcuts",
59 body : element,
87 body : element,
General Comments 0
You need to be logged in to leave comments. Login now