fixing onPaste in command with multiselect
This commit is contained in:
parent
8b9771fef9
commit
3604513a60
1 changed files with 10 additions and 6 deletions
|
|
@ -523,14 +523,18 @@ var Editor = require("./editor").Editor;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this._emit("paste", text);
|
this._emit("paste", text);
|
||||||
if (!this.inMultiSelectMode)
|
if (!this.inMultiSelectMode || this.inVirtualSelectionMode) {
|
||||||
return this.insert(text);
|
this.insert(text);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var lines = text.split(/\r\n|\r|\n/);
|
var lines = text.split(/\r\n|\r|\n/),
|
||||||
var ranges = this.selection.rangeList.ranges;
|
ranges = this.selection.rangeList.ranges;
|
||||||
|
|
||||||
if (lines.length > ranges.length || (lines.length <= 2 || !lines[1]))
|
if (lines.length > ranges.length || (lines.length <= 2 || !lines[1])) {
|
||||||
return this.commands.exec("insertstring", this, text);
|
this.commands.exec("insertstring", this, text);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (var i = ranges.length; i--; ) {
|
for (var i = ranges.length; i--; ) {
|
||||||
var range = ranges[i];
|
var range = ranges[i];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue