refactor(option): Rename code-editor-options.ts to option.ts and add wordWrap option

Renamed code-editor-options.ts to option.ts and added the wordWrap: "on" option to enable word wrapping in the code editor.
This commit is contained in:
cfngc4594 2025-02-23 15:05:30 +08:00
parent 269f41525b
commit 4cd56f6fab
3 changed files with 11 additions and 6 deletions

View File

@ -8,7 +8,7 @@ import { highlighter } from "@/lib/shiki";
import { DEFAULT_VALUE } from "@/config/value";
import { shikiToMonaco } from "@shikijs/monaco";
import { Skeleton } from "@/components/ui/skeleton";
import { CODE_EDITOR_OPTIONS } from "@/constants/code-editor-options";
import { CODE_EDITOR_OPTIONS } from "@/constants/option";
import { SUPPORTED_LANGUAGE_SERVERS } from "@/config/language-server";
import { useCodeEditorOption, useCodeEditorState } from "@/store/useCodeEditor";
import { toSocket, WebSocketMessageReader, WebSocketMessageWriter } from "vscode-ws-jsonrpc";

View File

@ -7,19 +7,24 @@ export const CODE_EDITOR_OPTIONS: monaco.editor.IEditorConstructionOptions = {
fontFamily: "Fira Code",
fontLigatures: true,
fontSize: 14,
lineHeight: 20,
guides: {
bracketPairs: true,
indentation: true,
},
hideCursorInOverviewRuler: true,
lineHeight: 20,
matchBrackets: "always",
minimap: {
enabled: false
},
wordWrap: "on",
padding: {
top: 18
top: 8
},
readOnly: false,
scrollbar: {
horizontalSliderSize: 4,
verticalSliderSize: 18
}
},
showFoldingControls: "always",
wordWrap: "on",
}

View File

@ -1,9 +1,9 @@
import { create } from "zustand";
import * as monaco from "monaco-editor";
import { DEFAULT_LANGUAGE } from "@/config/language";
import { CODE_EDITOR_OPTIONS } from "@/constants/option";
import { SupportedLanguage } from "@/constants/language";
import { MonacoLanguageClient } from "monaco-languageclient";
import { CODE_EDITOR_OPTIONS } from "@/constants/code-editor-options";
interface CodeEditorState {
language: SupportedLanguage;