* [misc] adjust monaco editor style.

This commit is contained in:
caoyanyi
2025-03-27 09:12:40 +08:00
committed by 田淑杰
parent ed7bae94b6
commit 819bf8022f
+18
View File
@@ -27,6 +27,24 @@ function createMonaco(id, action, options, diffContent, onMouseDown, onMouseMove
if(!lineMap && action == 'diff' && diffContent && diffContent.line) lineMap = diffContent.line.new;
if(lineMap) options.lineNumbers = (line) => {return lineMap[line - 1];};
$.extend(options, {
// 关键配置项
automaticLayout: true, // 自动调整布局
scrollBeyondLastLine: false, // 禁用底部滚动区域
minimap: { enabled: false }, // 可选:禁用缩略图以节省空间
// 编辑器尺寸配置
fontSize: 14,
lineHeight: 24,
lineNumbersMinChars: 2,
// 内边距设置
padding: {
top: 8,
bottom: 8
}
});
if(action == 'diff')
{
options.renderSideBySide = $.cookie.get('renderSideBySide') == 'true';