Fix characters swallowed during search

This resolves a bug where characters get swallowed when pressing them
after pressing backspace before the backspace key is released.
This commit is contained in:
Christian Duerr authored and GitHub committed 2020-08-09 23:29:58 +00:00
1 parent 4b516c6365
commit 1d00883f10
2 files changed
+5 -2

No files matched your search

+1
View File
@@ -28,6 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Incorrect window location with negative `window.position` config options - Incorrect window location with negative `window.position` config options
- Slow rendering performance with HiDPI displays, especially on macOS - Slow rendering performance with HiDPI displays, especially on macOS
- Keys swallowed during search when pressing them right before releasing backspace
## 0.5.0 ## 0.5.0
+4 -2
View File
@@ -863,7 +863,7 @@ impl<'a, T: EventListener, A: ActionContext<T>> Processor<'a, T, A> {
*self.ctx.received_count() = 0; *self.ctx.received_count() = 0;
self.process_key_bindings(input); self.process_key_bindings(input);
}, },
ElementState::Released => *self.ctx.suppress_chars() = false, ElementState::Released => (),
} }
} }
@@ -892,6 +892,8 @@ impl<'a, T: EventListener, A: ActionContext<T>> Processor<'a, T, A> {
} }
} }
*self.ctx.suppress_chars() = false;
return; return;
} }
@@ -951,7 +953,7 @@ impl<'a, T: EventListener, A: ActionContext<T>> Processor<'a, T, A> {
let binding = binding.clone(); let binding = binding.clone();
binding.execute(&mut self.ctx); binding.execute(&mut self.ctx);
// Don't suppress when there has been a `ReceiveChar` action. // Pass through the key if any of the bindings has the `ReceiveChar` action.
*suppress_chars.get_or_insert(true) &= binding.action != Action::ReceiveChar; *suppress_chars.get_or_insert(true) &= binding.action != Action::ReceiveChar;
} }
} }