Skip to content

editor: add clickable breakpoint gutter - #2619

Open
gintsgints wants to merge 3 commits into
longbridge:mainfrom
gintsgints:debug_gutter
Open

editor: add clickable breakpoint gutter#2619
gintsgints wants to merge 3 commits into
longbridge:mainfrom
gintsgints:debug_gutter

Conversation

@gintsgints

Copy link
Copy Markdown
Contributor

Summary

Adds an optional clickable breakpoint gutter to the multi-line editor (InputState), rendered as dots to the left of the line numbers — like the debug gutter in a code editor.

  • Set breakpoints render as a filled dot (theme danger).
  • Hovering the gutter reveals faint dots on every line so any line can be clicked to add a breakpoint.
  • Clicking a dot toggles the breakpoint and emits InputEvent::BreakpointToggled(line) (0-based buffer row).

API

InputState:

  • breakpoints_enabled(bool) — builder to enable the gutter (requires line numbers).
  • set_breakpoints_enabled(bool, cx) / is_breakpoints_enabled() — runtime toggle + getter.
  • breakpoints() / set_breakpoints(set, cx) — read/replace the breakpoint lines.
  • toggle_breakpoint(line, cx) — toggle a single line.

InputEvent::BreakpointToggled(usize) — emitted on toggle.

Notes

Gutter width reserves BREAKPOINT_DOT_WIDTH only when enabled, so existing editors are unaffected. Layout/paint mirrors the existing fold-icon path (layout_fold_icons).

AI-assisted; reviewed and refactored to match project style.

gintsgints and others added 3 commits July 29, 2026 20:05
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@huacnlee huacnlee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a good API design.

@gintsgints

gintsgints commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

I don't think this is a good API design.

You think that gutter idea is bad at all or you think realisation need improvement?

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.

2 participants