Show More
@@ -157,50 +157,8 b' var IPython = (function (IPython) {' | |||
|
157 | 157 | return false; |
|
158 | 158 | } |
|
159 | 159 | }, |
|
160 | 'tab' : { | |
|
161 | help : 'indent or complete', | |
|
162 | help_index : 'ec', | |
|
163 | }, | |
|
164 | 'shift-tab' : { | |
|
165 | help : 'tooltip', | |
|
166 | help_index : 'ed', | |
|
167 | }, | |
|
168 | 160 | }; |
|
169 | 161 | |
|
170 | if (platform === 'MacOS') { | |
|
171 | default_edit_shortcuts['cmd-/'] = | |
|
172 | { | |
|
173 | help : 'toggle comment', | |
|
174 | help_index : 'ee' | |
|
175 | }; | |
|
176 | default_edit_shortcuts['cmd-]'] = | |
|
177 | { | |
|
178 | help : 'indent', | |
|
179 | help_index : 'ef' | |
|
180 | }; | |
|
181 | default_edit_shortcuts['cmd-['] = | |
|
182 | { | |
|
183 | help : 'dedent', | |
|
184 | help_index : 'eg' | |
|
185 | }; | |
|
186 | } else { | |
|
187 | default_edit_shortcuts['ctrl-/'] = | |
|
188 | { | |
|
189 | help : 'toggle comment', | |
|
190 | help_index : 'ee' | |
|
191 | }; | |
|
192 | default_edit_shortcuts['ctrl-]'] = | |
|
193 | { | |
|
194 | help : 'indent', | |
|
195 | help_index : 'ef' | |
|
196 | }; | |
|
197 | default_edit_shortcuts['ctrl-['] = | |
|
198 | { | |
|
199 | help : 'dedent', | |
|
200 | help_index : 'eg' | |
|
201 | }; | |
|
202 | } | |
|
203 | ||
|
204 | 162 | // Command mode defaults |
|
205 | 163 | |
|
206 | 164 | var default_command_shortcuts = { |
@@ -12,12 +12,14 b' var IPython = (function (IPython) {' | |||
|
12 | 12 | |
|
13 | 13 | var QuickHelp = function (selector) { |
|
14 | 14 | }; |
|
15 | ||
|
15 | 16 | var cmd_ctrl = 'Ctrl'; |
|
17 | var platform_specific; | |
|
16 | 18 | |
|
17 | 19 | if (platform === 'MacOS') { |
|
18 | 20 | // Mac OS X specific |
|
19 | 21 | cmd_ctrl = 'Cmd'; |
|
20 |
|
|
|
22 | platform_specific = [ | |
|
21 | 23 | { shortcut: "Cmd-Up", help:"go to cell start" }, |
|
22 | 24 | { shortcut: "Cmd-End", help:"go to cell start" }, |
|
23 | 25 | { shortcut: "PageUp", help:"go to cell start" }, |
@@ -29,13 +31,13 b' var IPython = (function (IPython) {' | |||
|
29 | 31 | { shortcut: "Home", help:"go to line start" }, |
|
30 | 32 | { shortcut: "Cmd-Right", help:"go to line end" }, |
|
31 | 33 | { shortcut:"End", help:"go to line end" }, |
|
32 |
{ shortcut:"Alt-Backspace", |
|
|
33 |
{ shortcut:"Ctrl-Alt-Backspace", |
|
|
34 |
{ shortcut:"Alt-Delete", |
|
|
35 | ] | |
|
34 | { shortcut:"Alt-Backspace", help:"del word before" }, | |
|
35 | { shortcut:"Ctrl-Alt-Backspace", help:"del word after" }, | |
|
36 | { shortcut:"Alt-Delete", help:"del word after" }, | |
|
37 | ]; | |
|
36 | 38 | } else { |
|
37 | 39 | // PC specific |
|
38 |
|
|
|
40 | platform_specific = [ | |
|
39 | 41 | { shortcut: "Ctrl-Home", help:"go to cell start" }, |
|
40 | 42 | { shortcut: "Alt-Up", help:"go to cell start" }, |
|
41 | 43 | { shortcut: "PageUp", help:"go to cell start" }, |
@@ -51,13 +53,13 b' var IPython = (function (IPython) {' | |||
|
51 | 53 | { shortcut: "End", help:"go to line end" }, |
|
52 | 54 | { shortcut: "Ctrl-Backspace", help:"del word before" }, |
|
53 | 55 | { shortcut: "Ctrl-Delete", help:"del word after" }, |
|
54 | ] | |
|
56 | ]; | |
|
55 | 57 | } |
|
56 | 58 | |
|
57 | 59 | var cm_shortcuts = [ |
|
58 | 60 | { shortcut:"Insert", help:"toggle overwrite" }, |
|
59 | { shortcut:"Tab", help:"code completion" }, | |
|
60 |
{ shortcut:"Shift-Tab", help:" |
|
|
61 | { shortcut:"Tab", help:"code completion or indent" }, | |
|
62 | { shortcut:"Shift-Tab", help:"tooltip" }, | |
|
61 | 63 | { shortcut: cmd_ctrl + "-]", help:"indent" }, |
|
62 | 64 | { shortcut: cmd_ctrl + "-[", help:"dedent" }, |
|
63 | 65 | { shortcut: cmd_ctrl + "-A", help:"select all" }, |
@@ -108,13 +110,9 b' var IPython = (function (IPython) {' | |||
|
108 | 110 | element.append(cmd_div); |
|
109 | 111 | |
|
110 | 112 | // Edit mode |
|
111 | var edit_div = this.build_edit_help(); | |
|
113 | var edit_div = this.build_edit_help(cm_shortcuts); | |
|
112 | 114 | element.append(edit_div); |
|
113 | 115 | |
|
114 | // CodeMirror shortcuts | |
|
115 | var cm_div = build_div('', cm_shortcuts); | |
|
116 | element.append(cm_div); | |
|
117 | ||
|
118 | 116 | this.shortcut_dialog = IPython.dialog.modal({ |
|
119 | 117 | title : "Keyboard shortcuts", |
|
120 | 118 | body : element, |
@@ -151,10 +149,10 b' var IPython = (function (IPython) {' | |||
|
151 | 149 | |
|
152 | 150 | }; |
|
153 | 151 | |
|
154 | QuickHelp.prototype.build_edit_help = function () { | |
|
152 | QuickHelp.prototype.build_edit_help = function (cm_shortcuts) { | |
|
155 | 153 | var edit_shortcuts = IPython.keyboard_manager.edit_shortcuts.help(); |
|
156 | // Edit mode | |
|
157 |
return build_div('<h4>Edit Mode (press <code>Enter</code> to enable)</h4>', |
|
|
154 | jQuery.extend(cm_shortcuts, edit_shortcuts); | |
|
155 | return build_div('<h4>Edit Mode (press <code>Enter</code> to enable)</h4>', cm_shortcuts); | |
|
158 | 156 | }; |
|
159 | 157 | |
|
160 | 158 | var build_one = function (s) { |
General Comments 0
You need to be logged in to leave comments.
Login now