mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-09 02:52:38 +00:00
use CodeMirror Documents
Instead of re-building the whole editor box with every tab switch, we just swap in and out CodeMirror "documents". Maintains undo history, scroll position, highlight coloring, etc.
This commit is contained in:
@@ -63,11 +63,11 @@ const Snippetbar = createClass({
|
||||
if(!this.props.showEditButtons) return;
|
||||
|
||||
return <div className='editors'>
|
||||
<div className={`editorTool undo ${this.props.historySize()?.undo ? 'active' : ''}`}
|
||||
<div className={`editorTool undo ${this.props.historySize.undo ? 'active' : ''}`}
|
||||
onClick={this.props.undo} >
|
||||
<i className='fas fa-undo' />
|
||||
</div>
|
||||
<div className={`editorTool redo ${this.props.historySize()?.redo ? 'active' : ''}`}
|
||||
<div className={`editorTool redo ${this.props.historySize.redo ? 'active' : ''}`}
|
||||
onClick={this.props.redo} >
|
||||
<i className='fas fa-redo' />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user