From a6f64381281758a757fb994424884b7e13535a81 Mon Sep 17 00:00:00 2001 From: Jimmy Wu Date: Sat, 13 Jan 2024 14:04:18 -0500 Subject: [PATCH] Fallback to filename for +arg --- helix-term/src/args.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/helix-term/src/args.rs b/helix-term/src/args.rs index 6a49889b678a..0b1c9cde08da 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::() { - Ok(n) => n.saturating_sub(1), - _ => anyhow::bail!("bad line number after +"), + match arg[1..].parse::() { + Ok(n) => line_number = n.saturating_sub(1), + _ => args.files.push(parse_file(arg)), }; } arg => args.files.push(parse_file(arg)),