mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-03-27 10:18:11 +00:00
undo & redo
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { keymap } from '@codemirror/view';
|
import { keymap } from '@codemirror/view';
|
||||||
|
import { undo, redo } from '@codemirror/commands';
|
||||||
|
|
||||||
const indentMore = (view)=>{
|
const indentMore = (view)=>{
|
||||||
const { from, to } = view.state.selection.main;
|
const { from, to } = view.state.selection.main;
|
||||||
@@ -221,4 +222,6 @@ export const customKeymap = keymap.of([
|
|||||||
{ key: 'Shift-Mod-6', run: makeHeader(6) },
|
{ key: 'Shift-Mod-6', run: makeHeader(6) },
|
||||||
{ key: 'Shift-Mod-Enter', run: newColumn },
|
{ key: 'Shift-Mod-Enter', run: newColumn },
|
||||||
{ key: 'Mod-Enter', run: newPage },
|
{ key: 'Mod-Enter', run: newPage },
|
||||||
|
{ key: 'Mod-z', run: undo }, //i think it may be unnecessary
|
||||||
|
{ key: 'Mod-Shift-z', run: redo },
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -241,11 +241,11 @@ const Snippetbar = createReactClass({
|
|||||||
<i className='fas fa-clock-rotate-left' />
|
<i className='fas fa-clock-rotate-left' />
|
||||||
{ this.state.showHistory && this.renderHistoryItems() }
|
{ this.state.showHistory && this.renderHistoryItems() }
|
||||||
</div>
|
</div>
|
||||||
<div className={`editorTool undo ${this.props.historySize.undo ? 'active' : ''}`}
|
<div className={`editorTool undo ${this.props.historySize.done ? 'active' : ''}`}
|
||||||
onClick={this.props.undo} >
|
onClick={this.props.undo} >
|
||||||
<i className='fas fa-undo' />
|
<i className='fas fa-undo' />
|
||||||
</div>
|
</div>
|
||||||
<div className={`editorTool redo ${this.props.historySize.redo ? 'active' : ''}`}
|
<div className={`editorTool redo ${this.props.historySize.undone ? 'active' : ''}`}
|
||||||
onClick={this.props.redo} >
|
onClick={this.props.redo} >
|
||||||
<i className='fas fa-redo' />
|
<i className='fas fa-redo' />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user