allow modifying pasted text from paste event

This commit is contained in:
nightwing
2014-01-30 20:54:41 +04:00
parent 54ad13847a
commit 9253fffb9f
2 changed files with 7 additions and 3 deletions

View File

@@ -832,8 +832,9 @@ var Editor = function(renderer, session) {
// todo this should change when paste becomes a command
if (this.$readOnly)
return;
this._emit("paste", text);
this.insert(text);
var e = {text: text};
this._signal("paste", e);
this.insert(e.text, true);
};

View File

@@ -542,7 +542,10 @@ var Editor = require("./editor").Editor;
if (this.$readOnly)
return;
this._signal("paste", text);
var e = {text: text};
this._signal("paste", e);
text = e.text;
if (!this.inMultiSelectMode || this.inVirtualSelectionMode)
return this.insert(text);