Line Numbers not rendering to gutter correctly.
See original GitHub issueUsing Browserify.
If I toggle the included css being pointed to the numbers display correctly.
Like this:
.CodeMirror-gutter-elt {left: -29px !important}
The line numbers display correctly, after I include the above line of css.
Possibly related areas of code: https://github.com/JedWatson/react-codemirror/blob/master/lib/Codemirror.js#L23 https://github.com/JedWatson/react-codemirror/blob/master/dist/react-codemirror.js#L677-L678 https://github.com/JedWatson/react-codemirror/blob/master/dist/react-codemirror.js#L1052-L1063
I was also having difficulties with getting extra themes to work as well, since the className was not being appended to the correct elements.
var Editor = require('./codeeditorview/CodeMirror')
editorConfig: {
'mode': 'javascript',
'theme': 'cm-s-monokai',
'lineNumbers': true,
},
<Editor config={ this.items.editorConfig }/>
./codeeditorview/CodeMirror’:
'use strict';
var Codemirror = require('react-codemirror');
var Editor = React.createClass({
getInitialState: function() {
return {
code: 'function add(a, b) {\n' +
' return a + b;\n' +
'}'
};
},
updateCode: function(newCode) {
console.log('From the editor',newCode)
this.setState({
code: newCode
});
},
render: function() {
var options = this.props.config
return (
<Codemirror value={this.state.code} onChange={this.updateCode} options={options} />
)
}
});
// React.render(<App />, document.getElementById('app'));
module.exports = Editor
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:10
Top Results From Across the Web
Visual Studio 2012 Line-Number/Outlining Gutter Missing
Bellow is a picture of my current install which is missing the gutter and inset in the green border is a correctly working...
Read more >Corridor Gutter Pan Not Modeling Correctly - Autodesk Forums
Solved: I recently created a corridor with the Primary Road Full Section Assembly. I put in the cross slope of the gutter and...
Read more >Gutter line height doesn't match the actual view ... - CodeMirror
Implementing CodeMirror 6 in react (next.js). Everything works but the initial load seems to render the gutter numbers incorrectly.
Read more >Common Gutter Installation Mistakes - All Season Gutters
1. Wrong Gutter Placement ... The placement of your downspouts can significantly affect how well your system works, as can the number of...
Read more >Highlight specific line numbers in the gutter
In short I'm looking to write a simple plugin showing some simple warnings through colours, not relying on the sign column feature. I...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Use refresh or autorefresh , I require autorefresh.js and set option autoRefresh to true solved it. For more details
Did you guys really solve this problem ?
I used
autoRefresh: true
andimport 'codemirror/addon/display/autorefresh';
, wrong rendering still remains.