aboutsummaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
authorChristian Holman2023-07-19 02:05:32 +0000
committerGitHub2023-07-19 02:05:32 +0000
commit579f68b52d2d95bb28b52133c0a41ffaa3da644a (patch)
treecf48a525c8b56856258fe95d7190eaa274a73aa1 /helix-view
parentb47519ab11591b525132c5a13e464875b0c4f796 (diff)
allow for higher F keys to be used (#7672)
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/input.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-view/src/input.rs b/helix-view/src/input.rs
index d8832adc..5566a265 100644
--- a/helix-view/src/input.rs
+++ b/helix-view/src/input.rs
@@ -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))?
}
@@ -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());