diff --git a/node_modules/ace_tree/lib/ace_tree/edit.js b/node_modules/ace_tree/lib/ace_tree/edit.js index 09bb8dfb..a76f115f 100644 --- a/node_modules/ace_tree/lib/ace_tree/edit.js +++ b/node_modules/ace_tree/lib/ace_tree/edit.js @@ -258,6 +258,7 @@ var EditableTree = function(tree) { var ace = this.ace; this.ace = null; + this.$lastAce = ace; ace.renderer.freeze(); setTimeout(function() { // doing this after timeout to allow rename event focus something else @@ -267,6 +268,7 @@ var EditableTree = function(tree) { ace.wrapper.parentNode.removeChild(ace.wrapper); if (wasFocused) this.tree.focus(); + this.$lastAce = null; }.bind(this)); }; @@ -386,6 +388,7 @@ var EditableTree = function(tree) { var val = this.ace.getValue(); + this._destroyEditor(); if (!cancel && this.origVal !== val) { this.tree._emit("rename", { @@ -396,8 +399,6 @@ var EditableTree = function(tree) { }); this.tree.provider._signal("change"); } - - this._destroyEditor(); }; }).call(EditableTree.prototype); diff --git a/plugins/c9.ide.tree/tree.js b/plugins/c9.ide.tree/tree.js index 7aff77a6..34187998 100644 --- a/plugins/c9.ide.tree/tree.js +++ b/plugins/c9.ide.tree/tree.js @@ -520,7 +520,7 @@ define(function(require, exports, module) { } if (dirname(newpath) != dirname(path)) { - tree.edit.ace.blur(); // TODO this shouldn't be needed when apf focus works + tree.edit.$lastAce && tree.edit.$lastAce.blur(); // TODO this shouldn't be needed when apf focus works question( "Confirm move to a new folder", "move '" + e.oldValue + "' to \n" +