##// END OF EJS Templates
A single tab-completion match is now automatically selected.
Brian E. Granger -
Show More
@@ -220,7 +220,7 class NotebookManager(LoggingConfigurable):
220 220 else:
221 221 i = i+1
222 222 notebook_id = self.new_notebook_id(name)
223 nb = current.new_notebook(name=name, id=notebook_id)
223 nb = current.new_notebook(name=name)
224 224 with open(path,'w') as f:
225 225 current.write(nb, f, u'xml')
226 226 return notebook_id
@@ -94,6 +94,21 var IPython = (function (IPython) {
94 94
95 95 var that = this;
96 96 var cur = this.completion_cursor;
97
98 var insert = function (selected_text) {
99 that.code_mirror.replaceRange(
100 selected_text,
101 {line: cur.line, ch: (cur.ch-matched_text.length)},
102 {line: cur.line, ch: cur.ch}
103 );
104 };
105
106 if (matches.length === 1) {
107 insert(matches[0]);
108 setTimeout(function(){that.code_mirror.focus();}, 50);
109 return;
110 };
111
97 112 var complete = $('<div/>').addClass('completions');
98 113 var select = $('<select/>').attr('multiple','true');
99 114 for (var i=0; i<matches.length; ++i) {
@@ -109,14 +124,6 var IPython = (function (IPython) {
109 124 $('body').append(complete);
110 125 var done = false;
111 126
112 var insert = function (selected_text) {
113 that.code_mirror.replaceRange(
114 selected_text,
115 {line: cur.line, ch: (cur.ch-matched_text.length)},
116 {line: cur.line, ch: cur.ch}
117 );
118 };
119
120 127 var close = function () {
121 128 if (done) return;
122 129 done = true;
@@ -127,7 +127,6 var IPython = (function (IPython) {
127 127
128 128
129 129 TextCell.prototype.fromJSON = function (data) {
130 console.log(data);
131 130 if (data.cell_type === this.cell_type) {
132 131 if (data.source !== undefined) {
133 132 this.set_source(data.source);
General Comments 0
You need to be logged in to leave comments. Login now