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 {
271271 } ;
272272
273273 const mode = this . _cm . getOption ( 'mode' ) ;
274+ const currentPosition = this . _cm . doc . getCursor ( ) ;
274275 if ( mode === 'javascript' ) {
275276 this . _cm . doc . setValue ( beautifyJS ( this . _cm . doc . getValue ( ) , beautifyOptions ) ) ;
276277 } else if ( mode === 'css' ) {
277278 this . _cm . doc . setValue ( beautifyCSS ( this . _cm . doc . getValue ( ) , beautifyOptions ) ) ;
278279 } else if ( mode === 'htmlmixed' ) {
279280 this . _cm . doc . setValue ( beautifyHTML ( this . _cm . doc . getValue ( ) , beautifyOptions ) ) ;
280281 }
282+ this . _cm . doc . setCursor ( { line : currentPosition . line , ch : currentPosition . ch } ) ;
281283 }
282284
283285 initializeDocuments ( files ) {
You can’t perform that action at this time.
0 commit comments