diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 1304df5db..77c520431 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -19,6 +19,8 @@ const DEFAULT_STYLE_TEXT = dedent` color: black; }`; +const sourceMoveHighlightClass = 'sourceMoveFlash'; + const splice = function(str, index, inject){ return str.slice(0, index) + inject + str.slice(index); }; @@ -131,6 +133,7 @@ const Editor = createClass({ //reset custom line styles codeMirror.removeLineClass(lineNumber, 'background', 'pageLine'); codeMirror.removeLineClass(lineNumber, 'text'); + codeMirror.removeLineClass(lineNumber, 'wrap', sourceMoveHighlightClass); // Styling for \page breaks if((this.props.renderer == 'legacy' && line.includes('\\page')) || @@ -217,7 +220,9 @@ const Editor = createClass({ targetLine = lineCount; } - this.refs.codeEditor.setCursorPosition(targetLine, 0); + // this.refs.codeEditor.codeMirror.scrollIntoView({ line: targetLine, ch: 0 }, 30); + this.refs.codeEditor.setCursorPosition({ line: targetLine, ch: 0 }); + this.refs.codeEditor.codeMirror.addLineClass(targetLine, 'wrap', sourceMoveHighlightClass); } }, diff --git a/shared/naturalcrit/codeEditor/codeEditor.less b/shared/naturalcrit/codeEditor/codeEditor.less index bf36293ed..9f437e90b 100644 --- a/shared/naturalcrit/codeEditor/codeEditor.less +++ b/shared/naturalcrit/codeEditor/codeEditor.less @@ -10,6 +10,11 @@ font-weight: 600; } + .flash .CodeMirror-line{ + background-color: #0000fc; + color: #ffffff; + } + //.cm-tab { // background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAQAAACOs/baAAAARUlEQVR4nGJgIAG8JkXxUAcCtDWemcGR1lY4MvgzCEKY7jSBjgxBDAG09UEQzAe0AMwMHrSOAwEGRtpaMIwAAAAA//8DAG4ID9EKs6YqAAAAAElFTkSuQmCC) no-repeat right; //}