Fix error with setValue("\nfoo") when wrap mode is on
This commit is contained in:
parent
9e162f91b9
commit
95d3a2ada7
2 changed files with 21 additions and 0 deletions
|
|
@ -183,10 +183,17 @@ var Document = function(text) {
|
|||
var end = this.insertInLine(position, text);
|
||||
}
|
||||
else {
|
||||
// Insert the first line
|
||||
if (newLines[0].length > 0) {
|
||||
var end = this.insertInLine(position, newLines[0]);
|
||||
this.insertNewLine(end);
|
||||
}
|
||||
else {
|
||||
this.insertNewLine(position);
|
||||
}
|
||||
|
||||
// Now insert remaining lines
|
||||
|
||||
// If we are inserting at the end of the document, we don't need to
|
||||
// use insertInLine (concorde depends on this optimization!)
|
||||
if (position.row + 1 == this.getLength()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue