mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 16:39:02 +01:00
fix(type_widgets/code): not reacting to language changes
This commit is contained in:
parent
35f413505c
commit
308fd00508
@ -41,6 +41,11 @@ export default function CodeMirror({ className, content, mime, editorRef: extern
|
|||||||
codeEditor?.clearHistory();
|
codeEditor?.clearHistory();
|
||||||
}, [content]);
|
}, [content]);
|
||||||
|
|
||||||
|
// React to language change.
|
||||||
|
useEffect(() => {
|
||||||
|
codeEditorRef.current?.setMimeType(mime);
|
||||||
|
}, [ mime ]);
|
||||||
|
|
||||||
// React to line wrapping.
|
// React to line wrapping.
|
||||||
useEffect(() => codeEditorRef.current?.setLineWrapping(!!lineWrapping), [ lineWrapping ]);
|
useEffect(() => codeEditorRef.current?.setLineWrapping(!!lineWrapping), [ lineWrapping ]);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user