debugger: Add a couple more keybindings (#31103)
- Add missing handler for `debugger::Continue` so `f5` works - Add bindings based on VS Code for `debugger::Restart` and `debug_panel::ToggleFocus` - Remove breakpoint-related buttons from the debug panel's top strip, and surface the bindings for `editor::ToggleBreakpoint` in gutter tooltip instead Release Notes: - Debugger Beta: Added keybindings for `debugger::Continue`, `debugger::Restart`, and `debug_panel::ToggleFocus`. - Debugger Beta: Removed breakpoint-related buttons from the top of the debug panel. - Compatibility note: on Linux, `ctrl-shift-d` is now bound to `debug_panel::ToggleFocus` by default, instead of `editor::DuplicateLineDown`.
This commit is contained in:
parent
b2a92097ee
commit
5f452dbca2
5 changed files with 32 additions and 62 deletions
|
@ -7266,24 +7266,22 @@ impl Editor {
|
|||
..Default::default()
|
||||
};
|
||||
let primary_action_text = if breakpoint.is_disabled() {
|
||||
"enable"
|
||||
"Enable breakpoint"
|
||||
} else if is_phantom && !collides_with_existing {
|
||||
"set"
|
||||
"Set breakpoint"
|
||||
} else {
|
||||
"unset"
|
||||
"Unset breakpoint"
|
||||
};
|
||||
let mut primary_text = format!("Click to {primary_action_text}");
|
||||
if collides_with_existing && !breakpoint.is_disabled() {
|
||||
use std::fmt::Write;
|
||||
write!(primary_text, ", {alt_as_text}-click to disable").ok();
|
||||
}
|
||||
let primary_text = SharedString::from(primary_text);
|
||||
let focus_handle = self.focus_handle.clone();
|
||||
|
||||
let meta = if is_rejected {
|
||||
"No executable code is associated with this line."
|
||||
SharedString::from("No executable code is associated with this line.")
|
||||
} else if collides_with_existing && !breakpoint.is_disabled() {
|
||||
SharedString::from(format!(
|
||||
"{alt_as_text}-click to disable,\nright-click for more options."
|
||||
))
|
||||
} else {
|
||||
"Right-click for more options."
|
||||
SharedString::from("Right-click for more options.")
|
||||
};
|
||||
IconButton::new(("breakpoint_indicator", row.0 as usize), icon)
|
||||
.icon_size(IconSize::XSmall)
|
||||
|
@ -7322,7 +7320,14 @@ impl Editor {
|
|||
);
|
||||
}))
|
||||
.tooltip(move |window, cx| {
|
||||
Tooltip::with_meta_in(primary_text.clone(), None, meta, &focus_handle, window, cx)
|
||||
Tooltip::with_meta_in(
|
||||
primary_action_text,
|
||||
Some(&ToggleBreakpoint),
|
||||
meta.clone(),
|
||||
&focus_handle,
|
||||
window,
|
||||
cx,
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue