##// END OF EJS Templates
handle somehting selected and multiple cursors and 4 tabs show content in pager
Matthias Bussonnier -
Show More
@@ -230,7 +230,7 b' define(['
230 230 event.preventDefault();
231 231 return true;
232 232 } else if (event.keyCode === keycodes.tab && event.type === 'keydown' && event.shiftKey) {
233 if (editor.somethingSelected()){
233 if (editor.somethingSelected() || editor.getSelections().length !== 1){
234 234 var anchor = editor.getCursor("anchor");
235 235 var head = editor.getCursor("head");
236 236 if( anchor.line != head.line){
@@ -244,7 +244,9 b' define(['
244 244 } else if (event.keyCode === keycodes.tab && event.type == 'keydown') {
245 245 // Tab completion.
246 246 this.tooltip.remove_and_cancel_tooltip();
247 if (editor.somethingSelected()) {
247
248 // completion does not work on multicursor, it might be possible though in some cases
249 if (editor.somethingSelected() || editor.getSelections().length > 1) {
248 250 return false;
249 251 }
250 252 var pre_cursor = editor.getRange({line:cur.line,ch:0},cur);
@@ -94,7 +94,7 b' define(['
94 94 Completer.prototype.startCompletion = function () {
95 95 // call for a 'first' completion, that will set the editor and do some
96 96 // special behavior like autopicking if only one completion available.
97 if (this.editor.somethingSelected()) return;
97 if (this.editor.somethingSelected()|| this.editor.getSelections().length > 1) return;
98 98 this.done = false;
99 99 // use to get focus back on opera
100 100 this.carry_on_completion(true);
@@ -143,7 +143,7 b' define(['
143 143 }
144 144
145 145 // We want a single cursor position.
146 if (this.editor.somethingSelected()) {
146 if (this.editor.somethingSelected()|| editor.getSelections().length > 1) {
147 147 return;
148 148 }
149 149
@@ -117,8 +117,7 b' define(['
117 117
118 118 Tooltip.prototype.showInPager = function (cell) {
119 119 // reexecute last call in pager by appending ? to show back in pager
120 var that = this;
121 this.events.trigger('open_with_text.Pager', that._reply.content);
120 this.events.trigger('open_with_text.Pager', this._reply.content);
122 121 this.remove_and_cancel_tooltip();
123 122 };
124 123
@@ -208,7 +207,7 b' define(['
208 207 var msg_id = cell.kernel.inspect(text, cursor_pos, callbacks);
209 208 };
210 209
211 // make an imediate completion request
210 // make an immediate completion request
212 211 Tooltip.prototype.request = function (cell, hide_if_no_docstring) {
213 212 // request(codecell)
214 213 // Deal with extracting the text from the cell and counting
@@ -222,10 +221,11 b' define(['
222 221 this._hide_if_no_docstring = hide_if_no_docstring;
223 222
224 223 if(editor.somethingSelected()){
224 // get only the most recent selection.
225 225 text = editor.getSelection();
226 226 }
227 227
228 // need a permanent handel to code_mirror for future auto recall
228 // need a permanent handle to code_mirror for future auto recall
229 229 this.code_mirror = editor;
230 230
231 231 // now we treat the different number of keypress
@@ -325,7 +325,7 b' define(['
325 325 this.text.scrollTop(0);
326 326 };
327 327
328 // Backwards compatability.
328 // Backwards compatibility.
329 329 IPython.Tooltip = Tooltip;
330 330
331 331 return {'Tooltip': Tooltip};
General Comments 0
You need to be logged in to leave comments. Login now