@@ -24,7 +24,7 @@ use helix_view::{
24 Document, DocumentId, Editor, ViewId,
24 Document, DocumentId, Editor, ViewId,
27−use anyhow::{anyhow, bail, Context as _};
27+use anyhow::{anyhow, bail, ensure, Context as _};
28use helix_lsp::{
28use helix_lsp::{
29 block_on, lsp,
29 block_on, lsp,
30 util::{lsp_pos_to_pos, lsp_range_to_range, pos_to_lsp_pos, range_to_lsp_range},
30 util::{lsp_pos_to_pos, lsp_range_to_range, pos_to_lsp_pos, range_to_lsp_range},
@@ -2550,9 +2550,7 @@ mod cmd {
2550 args: &[&str],
2550 args: &[&str],
2551 _event: PromptEvent,
2551 _event: PromptEvent,
2552 ) -> anyhow::Result<()> {
2552 ) -> anyhow::Result<()> {
2553− if args.is_empty() {
2554− bail!("Line number required");
2553+ ensure!(!args.is_empty(), "Line number required");
2557 let line = args[0].parse::<usize>()?;
2555 let line = args[0].parse::<usize>()?;
@@ -5553,9 +5551,7 @@ fn shell_impl(
5553) -> anyhow::Result<(Tendril, bool)> {
5551) -> anyhow::Result<(Tendril, bool)> {
5554 use std::io::Write;
5552 use std::io::Write;
5555 use std::process::{Command, Stdio};
5553 use std::process::{Command, Stdio};
5556− if shell.is_empty() {
5554+ ensure!(!shell.is_empty(), "No shell set");
5557− bail!("No shell set");
5560 let mut process = match Command::new(&shell[0])
5556 let mut process = match Command::new(&shell[0])
5561 .args(&shell[1..])
5557 .args(&shell[1..])