mirror of https://github.com/helix-editor/helix
Fix panic when using multi-level key mapping
parent
5501669f8c
commit
fbba47fbc0
|
@ -140,7 +140,7 @@ impl KeyTrieNode {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
body.sort_unstable_by_key(|(_, keys)| {
|
body.sort_unstable_by_key(|(_, keys)| {
|
||||||
self.order.iter().position(|&k| k == keys[0]).unwrap()
|
self.order.iter().position(|&k| k == keys[0]).unwrap_or(0)
|
||||||
});
|
});
|
||||||
let prefix = format!("{} ", self.name());
|
let prefix = format!("{} ", self.name());
|
||||||
if body.iter().all(|(desc, _)| desc.starts_with(&prefix)) {
|
if body.iter().all(|(desc, _)| desc.starts_with(&prefix)) {
|
||||||
|
|
Loading…
Reference in New Issue