Skip to content

feat: minimap for CodeEditor, with error/match marks - #494

Merged
tannevaled merged 1 commit into
mainfrom
editor-minimap
Oct 22, 2026
Merged

tannevaled merged 1 commit into
mainfrom
editor-minimap

Conversation

@tannevaled

@tannevaled tannevaled commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Change

  • TextView.ShowMinimap (off by default, needs ShowScrollbars): the toolkit's existing CodeMinimap now sits between the text and the vertical scrollbar, fed with the editor's own token colours. Visible range = slider; press+drag on the slider keeps the pointer on the same spot, press elsewhere centres the window; wheel works as before. Takes its own columns (text area shrinks, horizontal track ends at it); hidden below four minimap widths.
  • CodeMinimap.Marks / MinimapMark / MarkKind and TextView.SetMinimapMarks: error, warning and match ticks on the right edge; SetMatchHighlights matches are marked automatically.
  • Contrast: slider outline and match ticks >= 3:1 against the panel (accent pulled toward OnSurface when needed: default-light was 2.53:1); error/warning colours chosen per theme lightness. Tested in 4 themes.
  • Cost: bounded by the window height (one sampled row per 3 px), +19 us per Draw on a 600x600 window over 5000 lines (216 -> 235 us).

Bibliography opened: VS Code minimap.ts (size modes proportional/fill/fit, slider only when scrollable, line height); the toolkit's own CodeMinimap.

Tests: layout, click-centre, slider-grab drag, sampling monotonicity on 20000 lines, marks and contrast, ensureContrast, benchmark. Stacked on #493 (released as v0.330.0).

🤖 Generated with Claude Code

TextView gains ShowMinimap (off by default; needs ShowScrollbars): the
existing CodeMinimap now sits between the text and the vertical scrollbar,
fed with the editor's own token colours. The visible range is the slider:
dragging it keeps the pointer on the same spot, pressing elsewhere centres the
window on that line. It takes its own columns from the text window and hides
itself in a window narrower than four minimap widths.

CodeMinimap gains Marks (error / warning / match ticks on its right edge) and
TextView/CodeEditor gain SetMinimapMarks; search matches from
SetMatchHighlights are marked automatically. The slider outline and the match
ticks keep >= 3:1 against the minimap panel (the accent is pulled toward
OnSurface when it would not), the red/amber ticks are chosen per theme
lightness for the same bound.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 88707dc into main Oct 22, 2026
1 check passed
@tannevaled
tannevaled deleted the editor-minimap branch October 22, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant