From 2e74ffbac31d95f39e4eaa64c3ca99ed570865df Mon Sep 17 00:00:00 2001 From: cfngc4594 Date: Tue, 13 May 2025 16:56:42 +0800 Subject: [PATCH] refactor(config): migrate editor options to standalone editor config - Rename `editor-language.ts` to `editor.ts` - Update interface from `IEditorConstructionOptions` to `IStandaloneEditorConstructionOptions` - Keep all existing editor options unchanged --- src/config/editor-option.ts | 45 ------------------------------------ src/config/editor.ts | 46 +++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 45 deletions(-) delete mode 100644 src/config/editor-option.ts create mode 100644 src/config/editor.ts diff --git a/src/config/editor-option.ts b/src/config/editor-option.ts deleted file mode 100644 index c8f9e6a..0000000 --- a/src/config/editor-option.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { type editor } from "monaco-editor"; - -export const DefaultEditorOptionConfig: editor.IEditorConstructionOptions = { - fontFamily: "Fira Code", - fontLigatures: true, - lineHeight: 20, - fontSize: 14, - bracketPairColorization: { - enabled: true, - }, - showFoldingControls: "always", - guides: { - bracketPairs: true, - bracketPairsHorizontal: "active", - highlightActiveBracketPair: true, - highlightActiveIndentation: "always", - indentation: true, - }, - hover: { - above: false, - }, - padding: { - top: 8, - }, - scrollbar: { - horizontalSliderSize: 10, - verticalSliderSize: 10, - }, - wordWrap: "on", - minimap: { - enabled: false, - }, - smoothScrolling: true, - stickyScroll: { - enabled: true, - maxLineCount: 5, - }, - cursorBlinking: "smooth", - cursorSmoothCaretAnimation: "on", - suggestSelection: "recentlyUsed", - autoIndent: "full", - automaticLayout: true, - contextmenu: true, - matchBrackets: "always", -}; diff --git a/src/config/editor.ts b/src/config/editor.ts new file mode 100644 index 0000000..d7bee3e --- /dev/null +++ b/src/config/editor.ts @@ -0,0 +1,46 @@ +import type { editor } from "monaco-editor"; + +export const DEFAULT_EDITOR_OPTIONS: editor.IStandaloneEditorConstructionOptions = + { + fontFamily: "Fira Code", + fontLigatures: true, + lineHeight: 20, + fontSize: 14, + bracketPairColorization: { + enabled: true, + }, + showFoldingControls: "always", + guides: { + bracketPairs: true, + bracketPairsHorizontal: "active", + highlightActiveBracketPair: true, + highlightActiveIndentation: "always", + indentation: true, + }, + hover: { + above: false, + }, + padding: { + top: 8, + }, + scrollbar: { + horizontalSliderSize: 10, + verticalSliderSize: 10, + }, + wordWrap: "on", + minimap: { + enabled: false, + }, + smoothScrolling: true, + stickyScroll: { + enabled: true, + maxLineCount: 5, + }, + cursorBlinking: "smooth", + cursorSmoothCaretAnimation: "on", + suggestSelection: "recentlyUsed", + autoIndent: "full", + automaticLayout: true, + contextmenu: true, + matchBrackets: "always", + };