mirror of
https://github.com/heyman/heynote.git
synced 2025-06-28 21:41:40 +02:00
This commit is contained in:
parent
ff980d240e
commit
574dcfdc24
@ -48,6 +48,7 @@
|
|||||||
syntaxTreeDebugContent: null,
|
syntaxTreeDebugContent: null,
|
||||||
editor: null,
|
editor: null,
|
||||||
onWindowClose: 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(WINDOW_CLOSE_EVENT, this.onWindowClose)
|
||||||
|
window.heynote.mainProcess.on(REDO_EVENT, this.onRedo)
|
||||||
window.document.addEventListener("currenciesLoaded", this.onCurrenciesLoaded)
|
window.document.addEventListener("currenciesLoaded", this.onCurrenciesLoaded)
|
||||||
|
|
||||||
// if debugSyntaxTree prop is set, display syntax tree for debugging
|
// if debugSyntaxTree prop is set, display syntax tree for debugging
|
||||||
@ -86,6 +94,7 @@
|
|||||||
|
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
window.heynote.mainProcess.off(WINDOW_CLOSE_EVENT, this.onWindowClose)
|
window.heynote.mainProcess.off(WINDOW_CLOSE_EVENT, this.onWindowClose)
|
||||||
|
window.heynote.mainProcess.off(REDO_EVENT, this.onRedo)
|
||||||
window.document.removeEventListener("currenciesLoaded", this.onCurrenciesLoaded)
|
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 { indentUnit, forceParsing, foldGutter, ensureSyntaxTree } from "@codemirror/language"
|
||||||
import { markdown } from "@codemirror/lang-markdown"
|
import { markdown } from "@codemirror/lang-markdown"
|
||||||
import { closeBrackets } from "@codemirror/autocomplete";
|
import { closeBrackets } from "@codemirror/autocomplete";
|
||||||
|
import { redo } from "@codemirror/commands"
|
||||||
|
|
||||||
import { heynoteLight } from "./theme/light.js"
|
import { heynoteLight } from "./theme/light.js"
|
||||||
import { heynoteDark } from "./theme/dark.js"
|
import { heynoteDark } from "./theme/dark.js"
|
||||||
@ -364,6 +365,10 @@ export class HeynoteEditor {
|
|||||||
this.view.dom.style.setProperty("display", "")
|
this.view.dom.style.setProperty("display", "")
|
||||||
triggerCursorChange(this.view)
|
triggerCursorChange(this.view)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
redo() {
|
||||||
|
redo(this.view)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user