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