Skip to content

Commit

Permalink
allow for higher F keys to be used (#7672)
Browse files Browse the repository at this point in the history
  • Loading branch information
christianholman authored Jul 19, 2023
1 parent b47519a commit 579f68b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helix-view/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ impl std::str::FromStr for KeyEvent {
function if function.len() > 1 && function.starts_with('F') => {
let function: String = function.chars().skip(1).collect();
let function = str::parse::<u8>(&function)?;
(function > 0 && function < 13)
(function > 0 && function < 25)
.then_some(KeyCode::F(function))
.ok_or_else(|| anyhow!("Invalid function key '{}'", function))?
}
Expand Down Expand Up @@ -682,7 +682,7 @@ mod test {

#[test]
fn parsing_nonsensical_keys_fails() {
assert!(str::parse::<KeyEvent>("F13").is_err());
assert!(str::parse::<KeyEvent>("F25").is_err());
assert!(str::parse::<KeyEvent>("F0").is_err());
assert!(str::parse::<KeyEvent>("aaa").is_err());
assert!(str::parse::<KeyEvent>("S-S-a").is_err());
Expand Down

0 comments on commit 579f68b

Please sign in to comment.