File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -888,11 +888,17 @@ const textLinesMutator = (lines) => {
888888 curSplice . push ( ...newLines ) ;
889889 curLine += newLines . length ;
890890 }
891- } else {
891+ } else if ( ! hasMore ( ) ) {
892892 // 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
894899 const sline = putCurLineInSplice ( ) ;
895900 if ( ! curSplice [ sline ] ) {
901+ // TODO should never happen now
896902 const err = new Error (
897903 'curSplice[sline] not populated, actual curSplice contents is ' +
898904 `${ JSON . stringify ( curSplice ) } . Possibly related to ` +
You can’t perform that action at this time.
0 commit comments