Show More
@@ -119,6 +119,10 b' span.section_row_buttons a {' | |||
|
119 | 119 | float: right; |
|
120 | 120 | } |
|
121 | 121 | |
|
122 | #smartcompleter_span { | |
|
123 | float: right; | |
|
124 | } | |
|
125 | ||
|
122 | 126 | .checkbox_label { |
|
123 | 127 | font-size: 85%; |
|
124 | 128 | float: right; |
@@ -179,6 +179,19 b' var IPython = (function (IPython) {' | |||
|
179 | 179 | |
|
180 | 180 | CodeCell.prototype.finish_completing = function (matched_text, matches) { |
|
181 | 181 | // console.log("Got matches", matched_text, matches); |
|
182 | var newm = new Array(); | |
|
183 | if(this.notebook.smart_completer) | |
|
184 | { | |
|
185 | kwargs = new Array(); | |
|
186 | other = new Array(); | |
|
187 | for(var i=0;i<matches.length; ++i){ | |
|
188 | if(matches[i].substr(-1) === '='){ | |
|
189 | kwargs.push(matches[i]); | |
|
190 | }else{other.push(matches[i]);} | |
|
191 | } | |
|
192 | newm = kwargs.concat(other); | |
|
193 | matches=newm; | |
|
194 | } | |
|
182 | 195 | if (!this.is_completing || matches.length === 0) {return;} |
|
183 | 196 | |
|
184 | 197 | var that = this; |
@@ -28,6 +28,7 b' var IPython = (function (IPython) {' | |||
|
28 | 28 | this.create_elements(); |
|
29 | 29 | this.bind_events(); |
|
30 | 30 | this.set_tooltipontab(true); |
|
31 | this.set_smartcompleter(true); | |
|
31 | 32 | this.set_timebeforetooltip(1200); |
|
32 | 33 | }; |
|
33 | 34 | |
@@ -633,6 +634,11 b' var IPython = (function (IPython) {' | |||
|
633 | 634 | this.tooltip_on_tab = state; |
|
634 | 635 | }; |
|
635 | 636 | |
|
637 | Notebook.prototype.set_smartcompleter = function (state) { | |
|
638 | console.log("Smart completion (kwargs first) changed to to : "+state); | |
|
639 | this.smart_completer = state; | |
|
640 | }; | |
|
641 | ||
|
636 | 642 | Notebook.prototype.set_autoindent = function (state) { |
|
637 | 643 | var cells = this.cells(); |
|
638 | 644 | len = cells.length; |
@@ -140,6 +140,8 b' var IPython = (function (IPython) {' | |||
|
140 | 140 | this.content.find('#timebeforetooltip').attr('title', 'Time before a tooltip auto-appear when "(" is pressed (negative value supress tooltip)'); |
|
141 | 141 | this.content.find('#timebeforetooltip_label').attr('title', 'Time before a tooltip auto-appear when "(" is pressed (negative value supress tooltip)'); |
|
142 | 142 | |
|
143 | this.content.find('#smartcompleter').attr('title', 'When inside function call, completer try to propose kwargs first'); | |
|
144 | this.content.find('#smartcompleter_label').attr('title', 'When inside function call, completer try to propose kwargs first'); | |
|
143 | 145 | }; |
|
144 | 146 | |
|
145 | 147 | |
@@ -153,6 +155,10 b' var IPython = (function (IPython) {' | |||
|
153 | 155 | var state = $('#timebeforetooltip').prop('value'); |
|
154 | 156 | IPython.notebook.set_timebeforetooltip(state); |
|
155 | 157 | }); |
|
158 | this.content.find('#smartcompleter').change(function () { | |
|
159 | var state = $('#smartcompleter').prop('checked'); | |
|
160 | IPython.notebook.set_smartcompleter(state); | |
|
161 | }); | |
|
156 | 162 | }; |
|
157 | 163 | |
|
158 | 164 | // CellSection |
@@ -263,6 +263,12 b'' | |||
|
263 | 263 | <span class="checkbox_label" id="tooltipontab_label">Tooltip on tab:</span> |
|
264 | 264 | </div> |
|
265 | 265 | <div class="section_row"> |
|
266 | <span id="smartcompleter_span"> | |
|
267 | <input type="checkbox" id="smartcompleter" checked="true"></input> | |
|
268 | </span> | |
|
269 | <span class="checkbox_label" id="smartcompleter_label">Smart completer:</span> | |
|
270 | </div> | |
|
271 | <div class="section_row"> | |
|
266 | 272 | <span id="tooltipontab_span"> |
|
267 | 273 | <input type="text" id="timebeforetooltip" value="1200"></input> |
|
268 | 274 | </span> |
General Comments 0
You need to be logged in to leave comments.
Login now