Skip to content

Commit

Permalink
remove command group function
Browse files Browse the repository at this point in the history
  • Loading branch information
QiBaobin committed Jan 24, 2023
1 parent 784380f commit 85d38a7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
1 change: 0 additions & 1 deletion book/src/generated/typable-cmd.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,3 @@
| `:pipe` | Pipe each selection to the shell command. |
| `:pipe-to` | Pipe each selection to the shell command, ignoring output. |
| `:run-shell-command`, `:sh` | Run a shell command |
| `:commands`, `:cmds` | Run commands together, use && to sepearte them |
32 changes: 0 additions & 32 deletions helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1822,31 +1822,6 @@ fn run_shell_command(
Ok(())
}

fn cmds(cx: &mut compositor::Context, args: &[Cow<str>], event: PromptEvent) -> anyhow::Result<()> {
if event != PromptEvent::Validate {
return Ok(());
}

let mut start;
let mut end = 0;
loop {
start = if end == 0 { 0 } else { end + 1 };
end = start + 1;
while end < args.len() {
if args[end] == "&&" {
break;
}
end += 1;
}

if start >= end || start >= args.len() {
break;
}
process_cmd(cx, &args[start..end].join(" "), event)?;
}
Ok(())
}

pub fn process_cmd(
cx: &mut compositor::Context,
input: &str,
Expand Down Expand Up @@ -2398,13 +2373,6 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
fun: run_shell_command,
completer: Some(completers::directory),
},
TypableCommand {
name: "commands",
aliases: &["cmds"],
doc: "Run commands together, use && to sepearte them",
fun: cmds,
completer: Some(completers::filename),
},
];

pub static TYPABLE_COMMAND_MAP: Lazy<HashMap<&'static str, &'static TypableCommand>> =
Expand Down

0 comments on commit 85d38a7

Please sign in to comment.