File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
client/modules/IDE/components Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -269,15 +269,19 @@ class Editor extends React.Component {
269
269
indent_size : INDENTATION_AMOUNT ,
270
270
indent_with_tabs : IS_TAB_INDENT
271
271
} ;
272
-
273
272
const mode = this . _cm . getOption ( 'mode' ) ;
273
+ const currentPosition = this . _cm . doc . getCursor ( ) ;
274
274
if ( mode === 'javascript' ) {
275
275
this . _cm . doc . setValue ( beautifyJS ( this . _cm . doc . getValue ( ) , beautifyOptions ) ) ;
276
276
} else if ( mode === 'css' ) {
277
277
this . _cm . doc . setValue ( beautifyCSS ( this . _cm . doc . getValue ( ) , beautifyOptions ) ) ;
278
278
} else if ( mode === 'htmlmixed' ) {
279
279
this . _cm . doc . setValue ( beautifyHTML ( this . _cm . doc . getValue ( ) , beautifyOptions ) ) ;
280
280
}
281
+ setTimeout ( ( ) => {
282
+ this . _cm . focus ( ) ;
283
+ this . _cm . doc . setCursor ( { line : currentPosition . line , ch : currentPosition . ch + INDENTATION_AMOUNT } ) ;
284
+ } , 0 ) ;
281
285
}
282
286
283
287
initializeDocuments ( files ) {
You can’t perform that action at this time.
0 commit comments