File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -888,11 +888,17 @@ const textLinesMutator = (lines) => {
888
888
curSplice . push ( ...newLines ) ;
889
889
curLine += newLines . length ;
890
890
}
891
- } else {
891
+ } else if ( ! hasMore ( ) ) {
892
892
// There are no additional lines. Although the line is put into splice, curLine is not
893
- // increased because there may be more chars in the line (newline is not reached).
893
+ // increased because there may be more chars in the line (newline is not reached). We are
894
+ // inserting at the end of lines. curCol is 0 as curLine is not in splice.
895
+ curSplice . push ( text ) ;
896
+ curCol += text . length ;
897
+ } else {
898
+ // insert text after curCol
894
899
const sline = putCurLineInSplice ( ) ;
895
900
if ( ! curSplice [ sline ] ) {
901
+ // TODO should never happen now
896
902
const err = new Error (
897
903
'curSplice[sline] not populated, actual curSplice contents is ' +
898
904
`${ JSON . stringify ( curSplice ) } . Possibly related to ` +
You can’t perform that action at this time.
0 commit comments