Skip to content

Commit ef786fc

Browse files
committed
wip
1 parent 420078f commit ef786fc

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

static/css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ input[type=checkbox]{cursor:pointer;margin-right:2px}
8989
background:#1e1e1e;
9090
display:none;
9191
flex-direction:column;
92-
min-height:120px;max-height:70vh;
92+
height:35vh;min-height:120px;max-height:70vh;
9393
}
9494
#peek.visible{display:flex}
9595
#peek-hdr{

static/js/editor.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ async function ensureEditor() {
482482
readOnly: true,
483483
minimap: {enabled: true, scale: 1, showSlider: 'mouseover'},
484484
scrollBeyondLastLine: false,
485-
fontSize: 12,
485+
fontSize: parseInt(localStorage.getItem('grepnavi-font-size')) || 12,
486486
lineNumbers: 'on',
487487
wordWrap: 'off',
488488
occurrencesHighlight: 'singleFile',
@@ -497,6 +497,19 @@ async function ensureEditor() {
497497
});
498498
new ResizeObserver(() => monacoEditor.layout()).observe(id('monaco-container'));
499499

500+
window.addEventListener('wheel', e => {
501+
if (!e.ctrlKey || !monacoEditor) return;
502+
const dom = monacoEditor.getDomNode();
503+
if (!dom) return;
504+
const r = dom.getBoundingClientRect();
505+
if (e.clientX < r.left || e.clientX > r.right || e.clientY < r.top || e.clientY > r.bottom) return;
506+
e.stopPropagation(); e.preventDefault();
507+
const cur = monacoEditor.getOption(monaco.editor.EditorOption.fontSize);
508+
const next = e.deltaY < 0 ? Math.min(cur + 1, 32) : Math.max(cur - 1, 8);
509+
monacoEditor.updateOptions({ fontSize: next });
510+
localStorage.setItem('grepnavi-font-size', next);
511+
}, { capture: true, passive: false });
512+
500513
// ===== C/C++ 言語固有拡張 (editor-c.js) =====
501514
const { resolveLocalVar } = initEditorC(monacoEditor, monaco);
502515

0 commit comments

Comments
 (0)