##// END OF EJS Templates
A single tab-completion match is now automatically selected.
Brian E. Granger -
Show More
@@ -220,7 +220,7 b' class NotebookManager(LoggingConfigurable):'
220 else:
220 else:
221 i = i+1
221 i = i+1
222 notebook_id = self.new_notebook_id(name)
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 with open(path,'w') as f:
224 with open(path,'w') as f:
225 current.write(nb, f, u'xml')
225 current.write(nb, f, u'xml')
226 return notebook_id
226 return notebook_id
@@ -94,6 +94,21 b' var IPython = (function (IPython) {'
94
94
95 var that = this;
95 var that = this;
96 var cur = this.completion_cursor;
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 var complete = $('<div/>').addClass('completions');
112 var complete = $('<div/>').addClass('completions');
98 var select = $('<select/>').attr('multiple','true');
113 var select = $('<select/>').attr('multiple','true');
99 for (var i=0; i<matches.length; ++i) {
114 for (var i=0; i<matches.length; ++i) {
@@ -109,14 +124,6 b' var IPython = (function (IPython) {'
109 $('body').append(complete);
124 $('body').append(complete);
110 var done = false;
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 var close = function () {
127 var close = function () {
121 if (done) return;
128 if (done) return;
122 done = true;
129 done = true;
@@ -127,7 +127,6 b' var IPython = (function (IPython) {'
127
127
128
128
129 TextCell.prototype.fromJSON = function (data) {
129 TextCell.prototype.fromJSON = function (data) {
130 console.log(data);
131 if (data.cell_type === this.cell_type) {
130 if (data.cell_type === this.cell_type) {
132 if (data.source !== undefined) {
131 if (data.source !== undefined) {
133 this.set_source(data.source);
132 this.set_source(data.source);
General Comments 0
You need to be logged in to leave comments. Login now