|
@@ -424,7 +424,7 @@ export default class CodeMirrorEditor extends AbstractEditor {
|
|
|
mode: 'gfm',
|
|
mode: 'gfm',
|
|
|
theme: editorOptions.theme,
|
|
theme: editorOptions.theme,
|
|
|
styleActiveLine: editorOptions.styleActiveLine,
|
|
styleActiveLine: editorOptions.styleActiveLine,
|
|
|
- lineNumbers: editorOptions.lineNumbers,
|
|
|
|
|
|
|
+ lineNumbers: this.props.lineNumbers,
|
|
|
tabSize: 4,
|
|
tabSize: 4,
|
|
|
indentUnit: 4,
|
|
indentUnit: 4,
|
|
|
lineWrapping: true,
|
|
lineWrapping: true,
|
|
@@ -433,8 +433,8 @@ export default class CodeMirrorEditor extends AbstractEditor {
|
|
|
matchBrackets: true,
|
|
matchBrackets: true,
|
|
|
matchTags: {bothTags: true},
|
|
matchTags: {bothTags: true},
|
|
|
// folding
|
|
// folding
|
|
|
- foldGutter: (editorOptions.lineNumbers ? true : false),
|
|
|
|
|
- gutters: (editorOptions.lineNumbers ? ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'] : []),
|
|
|
|
|
|
|
+ foldGutter: this.props.lineNumbers,
|
|
|
|
|
+ gutters: this.props.lineNumbers ? ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'] : [],
|
|
|
// match-highlighter, matchesonscrollbar, annotatescrollbar options
|
|
// match-highlighter, matchesonscrollbar, annotatescrollbar options
|
|
|
highlightSelectionMatches: {annotateScrollbar: true},
|
|
highlightSelectionMatches: {annotateScrollbar: true},
|
|
|
// markdown mode options
|
|
// markdown mode options
|
|
@@ -482,5 +482,8 @@ export default class CodeMirrorEditor extends AbstractEditor {
|
|
|
|
|
|
|
|
CodeMirrorEditor.propTypes = Object.assign({
|
|
CodeMirrorEditor.propTypes = Object.assign({
|
|
|
emojiStrategy: PropTypes.object,
|
|
emojiStrategy: PropTypes.object,
|
|
|
|
|
+ lineNumbers: PropTypes.bool,
|
|
|
}, AbstractEditor.propTypes);
|
|
}, AbstractEditor.propTypes);
|
|
|
-
|
|
|
|
|
|
|
+CodeMirrorEditor.defaultProps = {
|
|
|
|
|
+ lineNumbers: true,
|
|
|
|
|
+};
|