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,27 +446,19 @@ 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 . 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 ) ,
449+ model . applyEdits ( [
450+ {
451+ range : {
452+ startLineNumber : lastLine ,
453+ startColumn : lastCol ,
454+ endLineNumber : lastLine ,
455+ endColumn : lastCol ,
460456 } ,
461- ] ,
462- ( ) => null
463- )
457+ text : content . slice ( monacoValue . length ) ,
458+ } ,
459+ ] )
464460 } else {
465- model . pushEditOperations (
466- null ,
467- [ { range : model . getFullModelRange ( ) , text : content } ] ,
468- ( ) => null
469- )
461+ model . applyEdits ( [ { range : model . getFullModelRange ( ) , text : content } ] )
470462 }
471463 suppressScrollListenerRef . current = false
472464 lastSyncedContentRef . current = content
You can’t perform that action at this time.
0 commit comments