debugger: Add support for setting multiple breakpoints via actions (#28437)

Allow setting multiple breakpoints with multi cursors

Release Notes:

- N/A

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Remco Smits <djsmits12@gmail.com>
Co-authored-by: Anthony <anthony@zed.dev>
This commit is contained in:
Piotr Osiewicz 2025-04-11 05:31:57 +02:00 committed by GitHub
parent 5757e352b0
commit c35238bd72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 93 additions and 64 deletions

View file

@ -17999,7 +17999,15 @@ fn add_log_breakpoint_at_cursor(
cx: &mut Context<Editor>,
) {
let (anchor, bp) = editor
.breakpoint_at_cursor_head(window, cx)
.breakpoints_at_cursors(window, cx)
.first()
.and_then(|(anchor, bp)| {
if let Some(bp) = bp {
Some((*anchor, bp.clone()))
} else {
None
}
})
.unwrap_or_else(|| {
let cursor_position: Point = editor.selections.newest(cx).head();