fix multiselect paste
This commit is contained in:
parent
c142244d90
commit
330ed1ee2e
1 changed files with 3 additions and 5 deletions
|
|
@ -504,13 +504,11 @@ var Editor = require("./editor").Editor;
|
||||||
if (!this.inMultiSelectMode)
|
if (!this.inMultiSelectMode)
|
||||||
return this.insert(text);
|
return this.insert(text);
|
||||||
|
|
||||||
var lines = text.split(this.session.getDocument().getNewLineCharacter());
|
var lines = text.split(/\r\n|\r|\n/);
|
||||||
var ranges = this.selection.rangeList.ranges;
|
var ranges = this.selection.rangeList.ranges;
|
||||||
|
|
||||||
if (lines.length > ranges.length) {
|
if (lines.length > ranges.length || (lines.length <= 2 || !lines[1]))
|
||||||
this.commands.exec("insertstring", this, text);
|
return 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