Cherry-picked keymap_ui: Fix panic in clear keystrokes (#34909) Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ... Co-authored-by: Ben Kunkle <ben@zed.dev>
This commit is contained in:
parent
9eeb7a325e
commit
dfcf9a2b16
1 changed files with 4 additions and 1 deletions
|
@ -2784,6 +2784,7 @@ impl KeystrokeInput {
|
|||
else {
|
||||
log::trace!("No keybinding to stop recording keystrokes in keystroke input");
|
||||
self.close_keystrokes.take();
|
||||
self.close_keystrokes_start.take();
|
||||
return CloseKeystrokeResult::None;
|
||||
};
|
||||
let action_keystrokes = keybind_for_close_action.keystrokes();
|
||||
|
@ -2976,7 +2977,9 @@ impl KeystrokeInput {
|
|||
return;
|
||||
}
|
||||
window.focus(&self.outer_focus_handle);
|
||||
if let Some(close_keystrokes_start) = self.close_keystrokes_start.take() {
|
||||
if let Some(close_keystrokes_start) = self.close_keystrokes_start.take()
|
||||
&& close_keystrokes_start < self.keystrokes.len()
|
||||
{
|
||||
self.keystrokes.drain(close_keystrokes_start..);
|
||||
}
|
||||
self.close_keystrokes.take();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue