debugger: Show run to cursor in editor's context menu (#35745)

This also fixed a bug where evaluate selected text was an available
option when the selected debug session was terminated.


Release Notes:

- debugger: add Run to Cursor back to Editor's context menu

Co-authored-by: Remco Smits <djsmits12@gmail.com>
This commit is contained in:
Anthony Eid 2025-08-06 15:45:22 -04:00 committed by GitHub
parent f9038f6189
commit 010441e23b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 91 additions and 49 deletions

View file

@ -4248,6 +4248,25 @@ impl Window {
.on_action(action_type, Rc::new(listener));
}
/// Register an action listener on the window for the next frame if the condition is true.
/// The type of action is determined by the first parameter of the given listener.
/// When the next frame is rendered the listener will be cleared.
///
/// This is a fairly low-level method, so prefer using action handlers on elements unless you have
/// a specific need to register a global listener.
pub fn on_action_when(
&mut self,
condition: bool,
action_type: TypeId,
listener: impl Fn(&dyn Any, DispatchPhase, &mut Window, &mut App) + 'static,
) {
if condition {
self.next_frame
.dispatch_tree
.on_action(action_type, Rc::new(listener));
}
}
/// Read information about the GPU backing this window.
/// Currently returns None on Mac and Windows.
pub fn gpu_specs(&self) -> Option<GpuSpecs> {