Use ESC to cancel dragging in Zed (#30318)
Closes https://github.com/zed-industries/zed/issues/11887
ESC is always captured in terminal due to
980bfae331/crates/terminal/src/terminal.rs (L1339-L1353)
so this part is not fixed.
Otherwise, all other drags are cancelled when ESC is pressed:
https://github.com/user-attachments/assets/6e70a1e5-c244-420b-9dec-ae2ac2997a59
Release Notes:
- Allowed to use ESC to cancel dragging in Zed
This commit is contained in:
parent
83378b856f
commit
b4fbb9bc08
6 changed files with 39 additions and 7 deletions
|
@ -1537,6 +1537,17 @@ impl App {
|
|||
self.active_drag.is_some()
|
||||
}
|
||||
|
||||
/// Stops active drag and clears any related effects.
|
||||
pub fn stop_active_drag(&mut self, window: &mut Window) -> bool {
|
||||
if self.active_drag.is_some() {
|
||||
self.active_drag = None;
|
||||
window.refresh();
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
/// Set the prompt renderer for GPUI. This will replace the default or platform specific
|
||||
/// prompts with this custom implementation.
|
||||
pub fn set_prompt_builder(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue