mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 07:16:34 +00:00
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:
parent
269f41525b
commit
4cd56f6fab
@ -8,7 +8,7 @@ import { highlighter } from "@/lib/shiki";
|
|||||||
import { DEFAULT_VALUE } from "@/config/value";
|
import { DEFAULT_VALUE } from "@/config/value";
|
||||||
import { shikiToMonaco } from "@shikijs/monaco";
|
import { shikiToMonaco } from "@shikijs/monaco";
|
||||||
import { Skeleton } from "@/components/ui/skeleton";
|
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 { SUPPORTED_LANGUAGE_SERVERS } from "@/config/language-server";
|
||||||
import { useCodeEditorOption, useCodeEditorState } from "@/store/useCodeEditor";
|
import { useCodeEditorOption, useCodeEditorState } from "@/store/useCodeEditor";
|
||||||
import { toSocket, WebSocketMessageReader, WebSocketMessageWriter } from "vscode-ws-jsonrpc";
|
import { toSocket, WebSocketMessageReader, WebSocketMessageWriter } from "vscode-ws-jsonrpc";
|
||||||
|
@ -7,19 +7,24 @@ export const CODE_EDITOR_OPTIONS: monaco.editor.IEditorConstructionOptions = {
|
|||||||
fontFamily: "Fira Code",
|
fontFamily: "Fira Code",
|
||||||
fontLigatures: true,
|
fontLigatures: true,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
lineHeight: 20,
|
guides: {
|
||||||
|
bracketPairs: true,
|
||||||
|
indentation: true,
|
||||||
|
},
|
||||||
hideCursorInOverviewRuler: true,
|
hideCursorInOverviewRuler: true,
|
||||||
|
lineHeight: 20,
|
||||||
matchBrackets: "always",
|
matchBrackets: "always",
|
||||||
minimap: {
|
minimap: {
|
||||||
enabled: false
|
enabled: false
|
||||||
},
|
},
|
||||||
wordWrap: "on",
|
|
||||||
padding: {
|
padding: {
|
||||||
top: 18
|
top: 8
|
||||||
},
|
},
|
||||||
readOnly: false,
|
readOnly: false,
|
||||||
scrollbar: {
|
scrollbar: {
|
||||||
horizontalSliderSize: 4,
|
horizontalSliderSize: 4,
|
||||||
verticalSliderSize: 18
|
verticalSliderSize: 18
|
||||||
}
|
},
|
||||||
|
showFoldingControls: "always",
|
||||||
|
wordWrap: "on",
|
||||||
}
|
}
|
@ -1,9 +1,9 @@
|
|||||||
import { create } from "zustand";
|
import { create } from "zustand";
|
||||||
import * as monaco from "monaco-editor";
|
import * as monaco from "monaco-editor";
|
||||||
import { DEFAULT_LANGUAGE } from "@/config/language";
|
import { DEFAULT_LANGUAGE } from "@/config/language";
|
||||||
|
import { CODE_EDITOR_OPTIONS } from "@/constants/option";
|
||||||
import { SupportedLanguage } from "@/constants/language";
|
import { SupportedLanguage } from "@/constants/language";
|
||||||
import { MonacoLanguageClient } from "monaco-languageclient";
|
import { MonacoLanguageClient } from "monaco-languageclient";
|
||||||
import { CODE_EDITOR_OPTIONS } from "@/constants/code-editor-options";
|
|
||||||
|
|
||||||
interface CodeEditorState {
|
interface CodeEditorState {
|
||||||
language: SupportedLanguage;
|
language: SupportedLanguage;
|
||||||
|
Loading…
Reference in New Issue
Block a user