fix multiselect paste

This commit is contained in:
nightwing 2012-05-08 14:46:38 +04:00
commit 330ed1ee2e

View file

@ -504,13 +504,11 @@ var Editor = require("./editor").Editor;
if (!this.inMultiSelectMode)
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;
if (lines.length > ranges.length) {
this.commands.exec("insertstring", this, text);
return;
}
if (lines.length > ranges.length || (lines.length <= 2 || !lines[1]))
return this.commands.exec("insertstring", this, text);
for (var i = ranges.length; i--; ) {
var range = ranges[i];