File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/app/src/app/overmind/effects/vscode Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 55 Sandbox ,
66 UserSelection ,
77} from '@codesandbox/common/lib/types' ;
8+ import { getTextOperation } from '@codesandbox/common/lib/utils/diff' ;
89import { indexToLineAndColumn } from 'app/overmind/utils/common' ;
910import { actions , dispatch } from 'codesandbox-api' ;
1011import { css } from 'glamor' ;
@@ -195,8 +196,10 @@ export class ModelsHandler {
195196 return ;
196197 }
197198
199+ const oldCode = model . getValue ( ) ;
200+ const changeOperation = getTextOperation ( oldCode , module . code ) ;
198201 this . isApplyingOperation = true ;
199- await model . setValue ( module . code ) ;
202+ this . applyOperationToModel ( changeOperation , false , model ) ;
200203 this . isApplyingOperation = false ;
201204 }
202205
You can’t perform that action at this time.
0 commit comments