mirror of
https://github.com/sxyazi/yazi.git
synced 2024-12-23 00:31:38 +03:00
fix: keybindings disappear when mixing presets with a wrong filter condition (#1568)
This commit is contained in:
parent
ddb8ce530f
commit
b280d79f76
@ -67,10 +67,10 @@ impl<'de> Deserialize<'de> for Keymap {
|
|||||||
|
|
||||||
fn mix(mut a: IndexSet<Chord>, b: IndexSet<Chord>, c: IndexSet<Chord>) -> Vec<Chord> {
|
fn mix(mut a: IndexSet<Chord>, b: IndexSet<Chord>, c: IndexSet<Chord>) -> Vec<Chord> {
|
||||||
let mut seen = HashSet::new();
|
let mut seen = HashSet::new();
|
||||||
b.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_map(|v| v.on.get(1)).for_each(|&k| _ = seen.insert(k));
|
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()
|
Preset::mix(a, b, c).collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user