mirror of
https://github.com/AdaCore/ace.git
synced 2026-02-12 13:03:02 -08:00
allow modifying pasted text from paste event
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user