Improve keystroke search in keymap editor (#34567)
This PR improves Keystroke search by: 1. Allow searching by modifiers without additional keys. 2. Take match count into consideration when deciding if we should show an action as a search match. 3. Take order into consideration as well. Release Notes: - N/A --------- Co-authored-by: Ben Kunkle <ben@zed.dev>
This commit is contained in:
parent
573836a654
commit
13f4a093c8
2 changed files with 127 additions and 13 deletions
|
@ -417,6 +417,17 @@ impl Modifiers {
|
|||
self.control || self.alt || self.shift || self.platform || self.function
|
||||
}
|
||||
|
||||
/// Returns the XOR of two modifier sets
|
||||
pub fn xor(&self, other: &Modifiers) -> Modifiers {
|
||||
Modifiers {
|
||||
control: self.control ^ other.control,
|
||||
alt: self.alt ^ other.alt,
|
||||
shift: self.shift ^ other.shift,
|
||||
platform: self.platform ^ other.platform,
|
||||
function: self.function ^ other.function,
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether the semantically 'secondary' modifier key is pressed.
|
||||
///
|
||||
/// On macOS, this is the command key.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue