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