From f01245d027b6a15b3bd7c5ed75bb7db97965103c Mon Sep 17 00:00:00 2001 From: zhengkunwang223 <1paneldev@sina.com> Date: Tue, 2 Sep 2025 11:08:57 +0800 Subject: [PATCH] feat: Modify the configuration file to support tabs --- frontend/src/components/codemirror-pro/index.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/components/codemirror-pro/index.vue b/frontend/src/components/codemirror-pro/index.vue index 8440e4b52..da477012b 100644 --- a/frontend/src/components/codemirror-pro/index.vue +++ b/frontend/src/components/codemirror-pro/index.vue @@ -17,6 +17,8 @@ import { dockerFile } from '@codemirror/legacy-modes/mode/dockerfile'; import { javascript } from '@codemirror/legacy-modes/mode/javascript'; import { placeholder } from '@codemirror/view'; import { json } from '@codemirror/lang-json'; +import { keymap } from '@codemirror/view'; +import { defaultKeymap, indentWithTab } from '@codemirror/commands'; defineOptions({ name: 'CodemirrorPro' }); @@ -78,6 +80,7 @@ const initCodeMirror = () => { defaultTheme, oneDark, basicSetup, + keymap.of([...defaultKeymap, indentWithTab]), EditorView.updateListener.of((v: any) => { if (v.docChanged) { emit('update:modelValue', v.state.doc.toString());