mirror of
https://github.com/heyman/heynote.git
synced 2025-03-08 20:11:38 +01:00
This commit is contained in:
parent
ff980d240e
commit
574dcfdc24
src
@ -48,6 +48,7 @@
|
||||
syntaxTreeDebugContent: null,
|
||||
editor: null,
|
||||
onWindowClose: null,
|
||||
onRedo: null,
|
||||
}
|
||||
},
|
||||
|
||||
@ -61,7 +62,14 @@
|
||||
])
|
||||
}
|
||||
|
||||
this.onRedo = () => {
|
||||
if (this.editor) {
|
||||
toRaw(this.editor).redo()
|
||||
}
|
||||
}
|
||||
|
||||
window.heynote.mainProcess.on(WINDOW_CLOSE_EVENT, this.onWindowClose)
|
||||
window.heynote.mainProcess.on(REDO_EVENT, this.onRedo)
|
||||
window.document.addEventListener("currenciesLoaded", this.onCurrenciesLoaded)
|
||||
|
||||
// if debugSyntaxTree prop is set, display syntax tree for debugging
|
||||
@ -86,6 +94,7 @@
|
||||
|
||||
beforeUnmount() {
|
||||
window.heynote.mainProcess.off(WINDOW_CLOSE_EVENT, this.onWindowClose)
|
||||
window.heynote.mainProcess.off(REDO_EVENT, this.onRedo)
|
||||
window.document.removeEventListener("currenciesLoaded", this.onCurrenciesLoaded)
|
||||
},
|
||||
|
||||
|
@ -3,6 +3,7 @@ import { EditorView, keymap, drawSelection, ViewPlugin, lineNumbers } from "@cod
|
||||
import { indentUnit, forceParsing, foldGutter, ensureSyntaxTree } from "@codemirror/language"
|
||||
import { markdown } from "@codemirror/lang-markdown"
|
||||
import { closeBrackets } from "@codemirror/autocomplete";
|
||||
import { redo } from "@codemirror/commands"
|
||||
|
||||
import { heynoteLight } from "./theme/light.js"
|
||||
import { heynoteDark } from "./theme/dark.js"
|
||||
@ -364,6 +365,10 @@ export class HeynoteEditor {
|
||||
this.view.dom.style.setProperty("display", "")
|
||||
triggerCursorChange(this.view)
|
||||
}
|
||||
|
||||
redo() {
|
||||
redo(this.view)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user