11import React from 'react' ;
2- import AceEditor from 'react-ace' ;
3- import 'brace/mode/plain_text' ;
4- import 'brace/mode/markdown' ;
5- import 'brace/mode/json' ;
6- import 'brace/mode/javascript' ;
7- import 'brace/mode/c_cpp' ;
8- import 'brace/mode/java' ;
9- import 'brace/theme/tomorrow_night_eighties' ;
10- import 'brace/ext/searchbox' ;
112import faTrashAlt from '@fortawesome/fontawesome-free-solid/faTrashAlt' ;
123import faUser from '@fortawesome/fontawesome-free-solid/faUser' ;
134import { classes , extension } from '/common/util' ;
145import { actions } from '/reducers' ;
156import { connect } from 'react-redux' ;
167import { languages } from '/common/config' ;
17- import { Button , Ellipsis } from '/components' ;
8+ import { Button , Ellipsis , FoldableAceEditor } from '/components' ;
189import styles from './stylesheet.scss' ;
1910
2011@connect ( ( { env, player } ) => ( { env, player } ) , actions , null , { withRef : true } )
@@ -38,7 +29,7 @@ class CodeEditor extends React.Component {
3829 render ( ) {
3930 const { className, file, onClickDelete } = this . props ;
4031 const { user } = this . props . env ;
41- const { lineIndicator } = this . props . player ;
32+ const { lineIndicator, buildAt } = this . props . player ;
4233
4334 if ( ! file ) return null ;
4435
@@ -51,7 +42,7 @@ class CodeEditor extends React.Component {
5142
5243 return (
5344 < div className = { classes ( styles . code_editor , className ) } >
54- < AceEditor
45+ < FoldableAceEditor
5546 className = { styles . ace_editor }
5647 ref = { this . aceEditorRef }
5748 mode = { mode }
@@ -69,6 +60,7 @@ class CodeEditor extends React.Component {
6960 inFront : true ,
7061 _key : lineIndicator . cursor ,
7162 } ] : [ ] }
63+ foldAt = { buildAt }
7264 value = { file . content } />
7365 < div className = { classes ( styles . contributors_viewer , className ) } >
7466 < span className = { classes ( styles . contributor , styles . label ) } > Contributed by</ span >
0 commit comments