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 @@ -979,11 +979,17 @@ class TextLinesMutator {
979
979
this . _curSplice . push ( ...newLines ) ;
980
980
this . _curLine += newLines . length ;
981
981
}
982
- } else {
982
+ } else if ( ! this . hasMore ( ) ) {
983
983
// There are no additional lines. Although the line is put into splice, curLine is not
984
- // increased because there may be more chars in the line (newline is not reached).
984
+ // increased because there may be more chars in the line (newline is not reached). We are
985
+ // inserting at the end of lines. curCol is 0 as curLine is not in splice.
986
+ this . _curSplice . push ( text ) ;
987
+ this . _curCol += text . length ;
988
+ } else {
989
+ // insert text after curCol
985
990
const sline = this . _putCurLineInSplice ( ) ;
986
991
if ( ! this . _curSplice [ sline ] ) {
992
+ // TODO should never happen now
987
993
const err = new Error (
988
994
'curSplice[sline] not populated, actual curSplice contents is ' +
989
995
`${ JSON . stringify ( this . _curSplice ) } . Possibly related to ` +
You can’t perform that action at this time.
0 commit comments