remove trailing line after the cursor (#17431)

* remove trailing line after the cursor

* Addressed PR
This commit is contained in:
rajeshka
2021-10-21 11:04:31 -07:00
committed by GitHub
parent 4b26be5742
commit 914ac2b09d

View File

@@ -636,6 +636,10 @@ export class NotebookModel extends Disposable implements INotebookModel {
partialSource = source.slice(tailRange.startLineNumber - 1, tailRange.startLineNumber)[0].slice(tailRange.startColumn - 1);
tailSource.splice(0, 1, partialSource);
}
//Remove the trailing empty line after the cursor
if (tailSource[0] === '\r\n' || tailSource[0] === '\n') {
tailSource.splice(0, 1);
}
tailCell.source = tailSource;
tailCellIndex = newCellIndex + 1;
this.insertCell(tailCell, tailCellIndex);