From ae47eb42de6ea036fe4a5d84ff1fd094354b2027 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 31 May 2026 02:35:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=8C=E5=87=BB=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E6=A0=8F=E6=9C=80=E5=A4=A7=E5=8C=96=20+=20Monaco=E7=94=A8?= =?UTF-8?q?=E5=AE=98=E6=96=B9=E9=BB=98=E8=AE=A4=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 双击编辑器标题栏空白区域 → 切换最大化/还原 2. Monaco移除theme:'vs-dark'和fontFamily覆盖, 使用官方默认配置 3. 编辑器外观与 https://microsoft.github.io/monaco-editor 一致 --- web/app/files.html | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/web/app/files.html b/web/app/files.html index fe32e8c9..df99c57c 100644 --- a/web/app/files.html +++ b/web/app/files.html @@ -654,28 +654,17 @@ if(window._monacoReady){ tab.editor=monaco.editor.create(container,{ value:content,language:lang, - theme:'vs-dark', // 匹配 Nexus 暗色主题(官方默认 'vs' 亮色) + // 官方默认配置 — 不匹配项目主题 automaticLayout:true, - // 行号 + 折叠 (官方默认: lineNumbers='on', folding=true) lineNumbers:'on',folding:true, - // 括号匹配 (官方默认: matchBrackets='always', bracketPairColorization=true) bracketPairColorization:{enabled:true},matchBrackets:'always', - // 光标 (官方默认: cursorBlinking='blink', cursorStyle='line') cursorBlinking:'blink',cursorStyle:'line', - // 字体 (官方默认: fontSize=0即14, 无lineHeight/padding) fontSize:14, - fontFamily:"'Cascadia Code','Fira Code','JetBrains Mono',Menlo,Monaco,'Courier New',monospace", - // 换行 (官方默认: wordWrap='off') wordWrap:'off', - // 小地图 (官方默认: enabled=true) minimap:{enabled:true}, - // 滚动 (官方默认: scrollBeyondLastLine=true) scrollBeyondLastLine:true, - // 补全 (官方默认: suggestOnTriggerCharacters=true) suggestOnTriggerCharacters:true, - // 缩进 (官方默认: tabSize=4) tabSize:4, - // 其他官方默认行为 renderWhitespace:'none', links:true,colorDecorators:true, }); @@ -845,6 +834,11 @@ e.preventDefault(); } header.addEventListener('mousedown',startDrag); + // Double-click header to toggle maximize + header.addEventListener('dblclick',e=>{ + if(e.target.closest('button')||e.target.closest('input')||e.target.closest('select'))return; + toggleEditorSize(); + }); document.addEventListener('mousemove',e=>{ if(!dragging)return; const x=Math.max(0,Math.min(window.innerWidth-100,startLeft+e.clientX-startX));