Fix bug in Document.. If there are no lines after trimming off the spaces/tabs from the end return directly.
This commit is contained in:
parent
cb79193eff
commit
b59155af7d
1 changed files with 6 additions and 0 deletions
|
|
@ -879,6 +879,12 @@ var Document = function(text, mode) {
|
|||
}
|
||||
tabLine.splice(toRemove + 1);
|
||||
|
||||
// Shortcut: If there are no more tabLines, then there is nothing to
|
||||
// split up.
|
||||
if (tabLine.length == 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Remove spaces from the last tabLine to prevent splits only for
|
||||
// whitespaces as well.
|
||||
// E.g: "foo \tbar " -> "foo \tbar"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue