diff --git a/package.json b/package.json index bbacb9eb..0c5aea32 100644 --- a/package.json +++ b/package.json @@ -56,72 +56,5 @@ "architect-build", "msgpack-js", "c9" - ], - "c9plugins": { - "c9.ide.language": "#9843fc4875", - "c9.ide.language.core": "#208159eda7", - "c9.ide.language.css": "#5827caacda", - "c9.ide.language.generic": "#809e6994e6", - "c9.ide.language.html": "#ae00c111da", - "c9.ide.language.html.diff": "#33ac0f78aa", - "c9.ide.language.javascript": "#6f86fc7900", - "c9.ide.language.javascript.immediate": "#efc3518d0a", - "c9.ide.language.javascript.eslint": "#004c86f8ef", - "c9.ide.language.javascript.tern": "#cc569cfa6f", - "c9.ide.language.javascript.infer": "#d9f6dc5e51", - "c9.ide.language.jsonalyzer": "#6d0ed9fbf6", - "c9.ide.language.codeintel": "#435e084066", - "c9.ide.collab": "#5a2071f4ea", - "c9.ide.local": "#976ad9fca0", - "c9.ide.find": "#5c1d1ea078", - "c9.ide.find.infiles": "#d4762d1382", - "c9.ide.find.replace": "#1f96b87bf7", - "c9.ide.run.debug": "#91bc33714f", - "c9.automate": "#1c6006046e", - "c9.ide.ace.emmet": "#06791647c5", - "c9.ide.ace.gotoline": "#636d426035", - "c9.ide.ace.keymaps": "#832302482c", - "c9.ide.ace.repl": "#623561ecff", - "c9.ide.ace.split": "#d2143d8336", - "c9.ide.ace.statusbar": "#102340271c", - "c9.ide.ace.stripws": "#0aaa293283", - "c9.ide.behaviors": "#cc04e94c62", - "c9.ide.closeconfirmation": "#6b758eb957", - "c9.ide.configuration": "#5d8c381035", - "c9.ide.dialog.wizard": "#c8200c6ad1", - "c9.ide.fontawesome": "#96cb342a4a", - "c9.ide.format": "#660cf065ac", - "c9.ide.help.support": "#42d843e0db", - "c9.ide.imgeditor": "#353308ec1b", - "c9.ide.immediate": "#909e6f0bd1", - "c9.ide.installer": "#5f8f75eb2c", - "c9.ide.language.python": "#102398b335", - "c9.ide.language.go": "#e018761e24", - "c9.ide.navigate": "#992381bbf6", - "c9.ide.newresource": "#8ce79bb66c", - "c9.ide.openfiles": "#8ab1e2c85f", - "c9.ide.preview": "#a337636943", - "c9.ide.preview.browser": "#339cc3c10d", - "c9.ide.preview.markdown": "#df4b12c34c", - "c9.ide.pubsub": "#2accad6c0f", - "c9.ide.readonly": "#59bd0c4961", - "c9.ide.recentfiles": "#e8a52f2015", - "c9.ide.remote": "#14f717a0d5", - "c9.ide.processlist": "#99111d40fd", - "c9.ide.run": "#9dfbcebf81", - "c9.ide.run.build": "#652cd18587", - "c9.ide.run.debug.xdebug": "#def07a584b", - "c9.ide.run.debug.ikpdb": "#a223b727e0", - "c9.ide.save": "#9b06b29d7e", - "c9.ide.scm": "#a2dd947ed5", - "c9.ide.terminal.monitor": "#9dfda63972", - "c9.ide.test": "#4a56c01f66", - "c9.ide.test.mocha": "#ceace59aaf", - "c9.ide.theme.flat": "#6f9382edeb", - "c9.ide.threewaymerge": "#7a3a0dd1ad", - "c9.ide.undo": "#0e47e11192", - "c9.ide.upload": "#7ceff1a51d", - "c9.ide.welcome": "#b352446b17", - "c9.ide.guide": "#4249f58769" - } + ] } \ No newline at end of file diff --git a/plugins/c9.ide.terminal/predict_echo.js b/plugins/c9.ide.terminal/predict_echo.js index 44e40ecf..864d6356 100644 --- a/plugins/c9.ide.terminal/predict_echo.js +++ b/plugins/c9.ide.terminal/predict_echo.js @@ -152,7 +152,7 @@ define(function(require, exports, module) { command.after = { predict: predictLine, predictIndex: predictIndex }; command.sent = Date.now(); - DEBUG && console.log("!" + DEBUG && console.log("! " + nonPredictTerminal.$debugCharsAt(nonPredictTerminal.y) .slice(0, predictStartX) .map(function(c) { return c || " "; }) @@ -347,14 +347,14 @@ define(function(require, exports, module) { * @param {Object[]} predictions * @param {Function} callback * @param {Error} callback.err - * @param {Boolean} callback.result Whether prediction was succesful. + * @param {Object[]|Boolean} callback.results A list of matching predictions, or `false` */ function chopPredictions(e, predictions, callback) { var line = nonPredictTerminal.lines[nonPredictStartY]; var rowChanged = nonPredictStartY !== nonPredictTerminal.y + nonPredictTerminal.ybase; if (!checkTextBeforePrediction()) - return callback(null, false); + return done(null, false); // Check if predictions became true var matchedOneOff = false; @@ -600,12 +600,10 @@ define(function(require, exports, module) { }; function BackspaceCommand() { var after = predictLine.substr(predictIndex); - var deletedChar; var outputText = OUTPUTS_BACKSPACE_CHAR[0]; return { $outputText: outputText, do: function() { - deletedChar = peek(-1); predictLine = predictLine.substr(0, predictIndex - 1) + after; predictIndex--; echo(outputText); @@ -622,11 +620,9 @@ define(function(require, exports, module) { }; function DeleteCommand() { var after = predictLine.substr(predictIndex + 1); - var deletedChar; return { $outputText: OUTPUTS_DELETE_CHAR[0], do: function() { - deletedChar = peek(); predictLine = predictLine.substr(0, predictIndex) + after; echo(OUTPUTS_DELETE_CHAR[0]); } @@ -641,12 +637,10 @@ define(function(require, exports, module) { return new CursorLeftCommand(inputText); }; function CursorLeftCommand() { - var noChange = false; return { $outputText: OUTPUTS_LEFT[0], do: function() { if (predictIndex === 0) { - noChange = true; clearTimeout(this.timeout); return; } @@ -683,12 +677,10 @@ define(function(require, exports, module) { return new HomeCommand(inputText); }; function HomeCommand() { - var oldIndex; var outputText = predictIndex ? getCursorLeft(predictIndex) : ""; return { $outputText: outputText, do: function() { - oldIndex = predictIndex; echo(outputText); predictIndex = 0; } @@ -712,14 +704,8 @@ define(function(require, exports, module) { }; } - function charsOf(s) { - var r1 = []; - var r2 = []; - for (var i = 0; i < s.length; i++) { - r1.push(s.charAt(i)); - r2.push(s.charCodeAt(i)); - } - return [r1, r2]; + function charsOf(line) { + return line.map(function(c) { return c[1] }).join(""); } function getCursorLeft(n) { diff --git a/plugins/c9.ide.terminal/predict_echo_test.js b/plugins/c9.ide.terminal/predict_echo_test.js index 4213e66f..cffba81d 100644 --- a/plugins/c9.ide.terminal/predict_echo_test.js +++ b/plugins/c9.ide.terminal/predict_echo_test.js @@ -128,8 +128,10 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "ace/test/asse }); }); - function openTerminal(done) { + function openTerminal(callback) { tabs.openEditor("terminal", function(err, tab) { + if (err) return callback(err); + editor = tab.editor; session = editor.ace.getSession().c9session; send = session.send; @@ -219,6 +221,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "ace/test/asse send("\r"); }); session.$predictor.state = 0; + console.log("! next test"); sendAll(" # next*".split("")); });