-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not crash when run goto command without line number #1160
Conversation
7e0ef89
to
ca404a9
Compare
helix-term/src/commands.rs
Outdated
@@ -2485,6 +2485,10 @@ mod cmd { | |||
args: &[&str], | |||
_event: PromptEvent, | |||
) -> anyhow::Result<()> { | |||
if args.len() == 0 { | |||
return Ok(()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should return an error here, rather than failing silently.
return Ok(()); | |
bail!("Line number required"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that would be better than silencing the false path. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Omnikar Fixed. :)
Report an error when running goto command without entering a line number. Fixes helix-editor#1159
ca404a9
to
1dcfe47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I introduced the feature recently (it was merged today) I felt like giving a review :)
Thanks @wingyplus for catching it. I'm not sure how this could be caught by testing 🤔
Anyways, the fix is solid and solves the problem 👍
Report an error when running goto command without entering a
line number.
Fixes #1159