Skip to content

Commit

Permalink
Fallback to filename for +arg (helix-editor#9333)
Browse files Browse the repository at this point in the history
  • Loading branch information
jw013 authored and dgkf committed Jan 30, 2024
1 parent b3f5be9 commit 832e752
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions helix-term/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down

0 comments on commit 832e752

Please sign in to comment.