debugger: Do not allow setting breakpoints in buffers without file storage (#27094)
Closes #ISSUE Release Notes: - N/A
This commit is contained in:
parent
d722067000
commit
e03edc2a76
2 changed files with 19 additions and 7 deletions
|
@ -6052,6 +6052,9 @@ impl Editor {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if buffer.read(cx).file().is_none() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
let breakpoints = breakpoint_store.read(cx).breakpoints(
|
let breakpoints = breakpoint_store.read(cx).breakpoints(
|
||||||
&buffer,
|
&buffer,
|
||||||
Some(info.range.context.start..info.range.context.end),
|
Some(info.range.context.start..info.range.context.end),
|
||||||
|
|
|
@ -890,15 +890,24 @@ impl EditorElement {
|
||||||
let modifiers = event.modifiers;
|
let modifiers = event.modifiers;
|
||||||
let gutter_hovered = gutter_hitbox.is_hovered(window);
|
let gutter_hovered = gutter_hitbox.is_hovered(window);
|
||||||
editor.set_gutter_hovered(gutter_hovered, cx);
|
editor.set_gutter_hovered(gutter_hovered, cx);
|
||||||
|
editor.gutter_breakpoint_indicator = None;
|
||||||
|
|
||||||
if gutter_hovered {
|
if gutter_hovered {
|
||||||
editor.gutter_breakpoint_indicator = Some(
|
let new_point = position_map
|
||||||
position_map
|
|
||||||
.point_for_position(event.position)
|
.point_for_position(event.position)
|
||||||
.previous_valid,
|
.previous_valid;
|
||||||
);
|
let buffer_anchor = position_map
|
||||||
} else {
|
.snapshot
|
||||||
editor.gutter_breakpoint_indicator = None;
|
.display_point_to_anchor(new_point, Bias::Left);
|
||||||
|
|
||||||
|
if position_map
|
||||||
|
.snapshot
|
||||||
|
.buffer_snapshot
|
||||||
|
.buffer_for_excerpt(buffer_anchor.excerpt_id)
|
||||||
|
.is_some_and(|buffer| buffer.file().is_some())
|
||||||
|
{
|
||||||
|
editor.gutter_breakpoint_indicator = Some(new_point);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cx.notify();
|
cx.notify();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue