File tree Expand file tree Collapse file tree
src/vs/workbench/contrib/notebook/browser/viewModel Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,8 +173,7 @@ export class CodeCellViewModel extends BaseCellViewModel implements ICellViewMod
173173
174174 save ( ) {
175175 if ( this . _textModel && ! this . _textModel . isDisposed ( ) && this . editState === CellEditState . Editing ) {
176- let cnt = this . _textModel . getLineCount ( ) ;
177- this . model . source = this . _textModel . getLinesContent ( ) . map ( ( str , index ) => str + ( index !== cnt - 1 ? '\n' : '' ) ) ;
176+ this . model . source = this . _textModel . getLinesContent ( ) ;
178177 }
179178 }
180179
@@ -185,6 +184,7 @@ export class CodeCellViewModel extends BaseCellViewModel implements ICellViewMod
185184 this . _buffer = this . _textModel . getTextBuffer ( ) ;
186185 this . _register ( ref ) ;
187186 this . _register ( this . _textModel . onDidChangeContent ( ( ) => {
187+ this . editState = CellEditState . Editing ;
188188 this . model . contentChange ( ) ;
189189 this . _onDidChangeState . fire ( { contentChanged : true } ) ;
190190 } ) ) ;
You can’t perform that action at this time.
0 commit comments