mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
fix: bound code editor font size (#1581)
This commit is contained in:
parent
caa98b471c
commit
2c5aae1a98
@ -2,6 +2,7 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import { useOverrideConfigAtom } from "@/app/store/global";
|
import { useOverrideConfigAtom } from "@/app/store/global";
|
||||||
|
import { boundNumber } from "@/util/util";
|
||||||
import loader from "@monaco-editor/loader";
|
import loader from "@monaco-editor/loader";
|
||||||
import { Editor, Monaco } from "@monaco-editor/react";
|
import { Editor, Monaco } from "@monaco-editor/react";
|
||||||
import type * as MonacoTypes from "monaco-editor/esm/vs/editor/editor.api";
|
import type * as MonacoTypes from "monaco-editor/esm/vs/editor/editor.api";
|
||||||
@ -122,7 +123,7 @@ export function CodeEditor({ blockId, text, language, filename, meta, onChange,
|
|||||||
const minimapEnabled = useOverrideConfigAtom(blockId, "editor:minimapenabled") ?? false;
|
const minimapEnabled = useOverrideConfigAtom(blockId, "editor:minimapenabled") ?? false;
|
||||||
const stickyScrollEnabled = useOverrideConfigAtom(blockId, "editor:stickyscrollenabled") ?? false;
|
const stickyScrollEnabled = useOverrideConfigAtom(blockId, "editor:stickyscrollenabled") ?? false;
|
||||||
const wordWrap = useOverrideConfigAtom(blockId, "editor:wordwrap") ?? false;
|
const wordWrap = useOverrideConfigAtom(blockId, "editor:wordwrap") ?? false;
|
||||||
const fontSize = useOverrideConfigAtom(blockId, "editor:fontsize");
|
const fontSize = boundNumber(useOverrideConfigAtom(blockId, "editor:fontsize"), 6, 64);
|
||||||
const theme = "wave-theme-dark";
|
const theme = "wave-theme-dark";
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user