aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorjw0132024-01-14 14:11:18 +0000
committerGitHub2024-01-14 14:11:18 +0000
commit054ce3961af4006d66529fe5fbbc44b47e2ee079 (patch)
tree1a8aa4a7a23a1ed79dea567208f3ca93c2e193be /helix-term
parent17dd102e5cccbb2a9a0f0224af63e52f3dab846b (diff)
Fallback to filename for +arg (#9333)
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/args.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/helix-term/src/args.rs b/helix-term/src/args.rs
index 6a49889b..0b1c9cde 100644
--- a/helix-term/src/args.rs
+++ b/helix-term/src/args.rs
@@ -90,10 +90,9 @@ impl Args {
}
}
arg if arg.starts_with('+') => {
- let arg = &arg[1..];
- line_number = match arg.parse::<usize>() {
- Ok(n) => n.saturating_sub(1),
- _ => anyhow::bail!("bad line number after +"),
+ match arg[1..].parse::<usize>() {
+ Ok(n) => line_number = n.saturating_sub(1),
+ _ => args.files.push(parse_file(arg)),
};
}
arg => args.files.push(parse_file(arg)),