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
This commit is contained in:
cfngc4594 2025-05-13 16:56:42 +08:00
parent 49419654a0
commit 2e74ffbac3
2 changed files with 46 additions and 45 deletions

View File

@ -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",
};

46
src/config/editor.ts Normal file
View File

@ -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",
};