Skip to content

Commit

Permalink
Add a yank diagnostic command (helix-editor#9640)
Browse files Browse the repository at this point in the history
* yank diagnostic command

* improve success message

* move to a typed command

* docgen
  • Loading branch information
kirawi authored and postsolar committed Apr 4, 2024
1 parent cf8d0a8 commit 88aa9ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions book/src/generated/typable-cmd.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,4 @@
| `:move` | Move the current buffer and its corresponding file to a different path |
| `:yank-diagnostic` | Yank diagnostic(s) under primary cursor to register, or clipboard by default |
| `:echo` | Print the processed input to the editor status |
| `:yank-diagnostic` | Yank diagnostic(s) under primary cursor to register, or clipboard by default |
8 changes: 2 additions & 6 deletions helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2459,11 +2459,8 @@ fn echo(cx: &mut compositor::Context, args: &[Cow<str>], event: PromptEvent) ->
if event != PromptEvent::Validate {
return Ok(());
}

let args = args.join(" ");

cx.editor.set_status(args);

Ok(())
}

Expand Down Expand Up @@ -3075,19 +3072,18 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
signature: CommandSignature::positional(&[completers::filename]),
},
TypableCommand {
<<<<<<< HEAD
name: "yank-diagnostic",
aliases: &[],
doc: "Yank diagnostic(s) under primary cursor to register, or clipboard by default",
fun: yank_diagnostic,
signature: CommandSignature::none(),
=======
},
TypableCommand {
name: "echo",
aliases: &[],
doc: "Print the processed input to the editor status",
fun: echo,
signature: CommandSignature::all(completers::variables)
>>>>>>> 4c576d45 (Add echo command. Add %{cwd})
},
];

Expand Down

0 comments on commit 88aa9ca

Please sign in to comment.