File tree Expand file tree Collapse file tree 4 files changed +8
-2
lines changed Expand file tree Collapse file tree 4 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import CodeMirror from 'codemirror' ;
3
3
import 'codemirror/mode/javascript/javascript' ;
4
+ import 'codemirror/addon/selection/active-line'
4
5
5
6
class Editor extends React . Component {
6
7
_cm : CodeMirror . Editor
@@ -10,6 +11,7 @@ class Editor extends React.Component {
10
11
theme : 'p5-widget' ,
11
12
value : this . props . content ,
12
13
lineNumbers : true ,
14
+ styleActiveLine : true ,
13
15
mode : 'javascript'
14
16
} ) ;
15
17
this . _cm . on ( 'change' , ( ) => {
Original file line number Diff line number Diff line change @@ -33,4 +33,5 @@ $dark-button-hover-color: $white;
33
33
$dark-button-active-color : $white ;
34
34
35
35
$editor-border-color : #f4f4f4 ;
36
+ $editor-selected-line-color : #f3f3f3 ;
36
37
Original file line number Diff line number Diff line change 14
14
15
15
.CodeMirror-lines {
16
16
padding-top : #{25 / $base-font-size } rem;
17
- padding-left : #{5 / $base-font-size } rem;
17
+ }
18
+
19
+ .CodeMirror-line {
20
+ padding-left : #{5 / $base-font-size } rem;
18
21
}
Original file line number Diff line number Diff line change 26
26
27
27
.cm-s-p5-widget span .cm-error { color : #f00 ; }
28
28
29
- .cm-s-p5-widget .CodeMirror-activeline-background { background : #e8f2ff ; }
29
+ .cm-s-p5-widget .CodeMirror-activeline-background { background-color : #e8f2ff ; }
30
30
.cm-s-p5-widget .CodeMirror-matchingbracket { outline :1px solid grey ; color :black !important ; }
31
31
32
32
/* These styles don't seem to be set by CodeMirror's javascript mode. */
You can’t perform that action at this time.
0 commit comments