File tree Expand file tree Collapse file tree
apps/sim/app/workspace/[workspaceId]/files/components/file-viewer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -446,19 +446,27 @@ export const TextEditor = memo(function TextEditor({
446446 if ( content . startsWith ( monacoValue ) && monacoValue . length < content . length ) {
447447 const lastLine = model . getLineCount ( )
448448 const lastCol = model . getLineMaxColumn ( lastLine )
449- model . applyEdits ( [
450- {
451- range : {
452- startLineNumber : lastLine ,
453- startColumn : lastCol ,
454- endLineNumber : lastLine ,
455- endColumn : lastCol ,
449+ model . pushEditOperations (
450+ null ,
451+ [
452+ {
453+ range : {
454+ startLineNumber : lastLine ,
455+ startColumn : lastCol ,
456+ endLineNumber : lastLine ,
457+ endColumn : lastCol ,
458+ } ,
459+ text : content . slice ( monacoValue . length ) ,
456460 } ,
457- text : content . slice ( monacoValue . length ) ,
458- } ,
459- ] )
461+ ] ,
462+ ( ) => null
463+ )
460464 } else {
461- model . applyEdits ( [ { range : model . getFullModelRange ( ) , text : content } ] )
465+ model . pushEditOperations (
466+ null ,
467+ [ { range : model . getFullModelRange ( ) , text : content } ] ,
468+ ( ) => null
469+ )
462470 }
463471 suppressScrollListenerRef . current = false
464472 lastSyncedContentRef . current = content
You can’t perform that action at this time.
0 commit comments