add word line

This commit is contained in:
MathuraMG 2016-08-25 12:32:06 -04:00
parent 76492cec6f
commit db85dcc04b
2 changed files with 3 additions and 2 deletions

View file

@ -54,7 +54,8 @@ class Editor extends React.Component {
this.props.updateFileContent(this.props.file.name, this._cm.getValue());
}));
this._cm.on('keyup', () => {
this.props.updateLineNumber(parseInt((this._cm.getCursor().line) + 1, 10));
const temp = `line ${parseInt((this._cm.getCursor().line) + 1, 10)}`;
document.getElementById('current-line').innerHTML = temp;
});
// this._cm.on('change', () => { // eslint-disable-line
// // this.props.updateFileContent('sketch.js', this._cm.getValue());

View file

@ -27,7 +27,7 @@ class EditorAccessibility extends React.Component {
{messages}
</ul>
<p> Current line
<span className="editor-linenumber" aria-live="polite" aria-atomic="true" id="current-line"> {this.props.lineNumber} </span>
<span className="editor-linenumber" aria-live="polite" aria-atomic="true" id="current-line"> </span>
</p>
</div>
);