File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
src/vs/workbench/contrib/notebook/common/model Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,10 @@ export class NotebookCellTextModel extends Disposable implements ICell {
206
206
this . _internalMetadata = internalMetadata ?? { } ;
207
207
}
208
208
209
+ resetTextBuffer ( textBuffer : model . ITextBuffer ) {
210
+ this . _textBuffer = textBuffer ;
211
+ }
212
+
209
213
getValue ( ) : string {
210
214
const fullRange = this . getFullModelRange ( ) ;
211
215
const eol = this . textBuffer . getEOL ( ) ;
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import { IModelService } from 'vs/editor/common/services/modelService';
18
18
import { Schemas } from 'vs/base/common/network' ;
19
19
import { isEqual } from 'vs/base/common/resources' ;
20
20
import { IModeService } from 'vs/editor/common/services/modeService' ;
21
- import { ITextBuffer , ITextModel } from 'vs/editor/common/model' ;
21
+ import { ITextModel } from 'vs/editor/common/model' ;
22
22
import { TextModel } from 'vs/editor/common/model/textModel' ;
23
23
import { isDefined } from 'vs/base/common/types' ;
24
24
@@ -607,9 +607,8 @@ export class NotebookTextModel extends Disposable implements INotebookTextModel
607
607
if ( textModel && textModel instanceof TextModel ) {
608
608
cell . textModel = textModel ;
609
609
cell . language = cellDto . language ;
610
- if ( ! cell . textModel . equalsTextBuffer ( cell . textBuffer as ITextBuffer ) ) {
611
- cell . textModel . setValue ( cellDto . source ) ;
612
- }
610
+ cell . textModel . setValue ( cellDto . source ) ;
611
+ cell . resetTextBuffer ( cell . textModel . getTextBuffer ( ) ) ;
613
612
}
614
613
const dirtyStateListener = cell . onDidChangeContent ( ( e ) => {
615
614
this . _bindCellContentHandler ( cell , e ) ;
You can’t perform that action at this time.
0 commit comments