mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-21 23:01:05 +00:00
fix: keybindings disappear when mixing presets with a wrong filter condition (#1568)
This commit is contained in:
parent
ddb8ce530f
commit
b280d79f76
1 changed files with 3 additions and 3 deletions
|
|
@ -67,10 +67,10 @@ impl<'de> Deserialize<'de> for Keymap {
|
|||
|
||||
fn mix(mut a: IndexSet<Chord>, b: IndexSet<Chord>, c: IndexSet<Chord>) -> Vec<Chord> {
|
||||
let mut seen = HashSet::new();
|
||||
b.iter().filter_map(|v| v.on.get(1)).for_each(|&k| _ = seen.insert(k));
|
||||
c.iter().filter_map(|v| v.on.get(1)).for_each(|&k| _ = seen.insert(k));
|
||||
b.iter().filter(|&v| v.on.len() > 1).for_each(|v| _ = seen.insert(&v.on[..2]));
|
||||
c.iter().filter(|&v| v.on.len() > 1).for_each(|v| _ = seen.insert(&v.on[..2]));
|
||||
|
||||
a.retain(|v| v.on.len() < 2 || !seen.contains(&v.on[1]));
|
||||
a.retain(|v| v.on.len() < 2 || !seen.contains(&v.on[..2]));
|
||||
Preset::mix(a, b, c).collect()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue