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 {
269269 indent_size : INDENTATION_AMOUNT ,
270270 indent_with_tabs : IS_TAB_INDENT
271271 } ;
272-
272+ console . log ( 'inside' ) ;
273273 const mode = this . _cm . getOption ( 'mode' ) ;
274274 const currentPosition = this . _cm . doc . getCursor ( ) ;
275275 if ( mode === 'javascript' ) {
276276 this . _cm . doc . setValue ( beautifyJS ( this . _cm . doc . getValue ( ) , beautifyOptions ) ) ;
277+ console . log ( 'beautifying' ) ;
277278 } else if ( mode === 'css' ) {
278279 this . _cm . doc . setValue ( beautifyCSS ( this . _cm . doc . getValue ( ) , beautifyOptions ) ) ;
279280 } else if ( mode === 'htmlmixed' ) {
280281 this . _cm . doc . setValue ( beautifyHTML ( this . _cm . doc . getValue ( ) , beautifyOptions ) ) ;
281282 }
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+ } ) ;
283287 }
284288
285289 initializeDocuments ( files ) {
You can’t perform that action at this time.
0 commit comments