pull/10977/head
Evgeniy Tatarkin 2025-01-06 13:26:29 +03:00
parent bb62dad76f
commit 94b5e0c210
1 changed files with 13 additions and 15 deletions

View File

@ -338,8 +338,7 @@ impl std::str::FromStr for KeyEvent {
KeyCode::from_str(tokens.pop().ok_or_else(|| anyhow!("Missing key code"))?)
{
code
} else {
if s.ends_with('-') && tokens.last().is_some_and(|t| t.is_empty()) {
} else if s.ends_with('-') && tokens.last().is_some_and(|t| t.is_empty()) {
if s == "-" {
return Ok(KeyEvent {
code: KeyCode::Char('-'),
@ -354,7 +353,6 @@ impl std::str::FromStr for KeyEvent {
}
} else {
anyhow::bail!("Invalid key code '{}'", s)
}
};
let mut modifiers = KeyModifiers::empty();
for token in tokens {