mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-24 18:36:18 +04:00
feat(commands): add log-open command (#2422)
This commit is contained in:
parent
0477d02894
commit
a5bc69c2b5
@ -63,5 +63,6 @@
|
||||
| `:tree-sitter-subtree`, `:ts-subtree` | Display tree sitter subtree under cursor, primarily for debugging queries. |
|
||||
| `:config-reload` | Refreshes helix's config. |
|
||||
| `:config-open` | Open the helix config.toml file. |
|
||||
| `:log-open` | Open the helix log file. |
|
||||
| `:pipe` | Pipe each selection to the shell command. |
|
||||
| `:run-shell-command`, `:sh` | Run a shell command |
|
||||
|
@ -1146,6 +1146,15 @@ fn open_config(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn open_log(
|
||||
cx: &mut compositor::Context,
|
||||
_args: &[Cow<str>],
|
||||
_event: PromptEvent,
|
||||
) -> anyhow::Result<()> {
|
||||
cx.editor.open(helix_loader::log_file(), Action::Replace)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn refresh_config(
|
||||
cx: &mut compositor::Context,
|
||||
_args: &[Cow<str>],
|
||||
@ -1647,6 +1656,13 @@ fn run_shell_command(
|
||||
fun: open_config,
|
||||
completer: None,
|
||||
},
|
||||
TypableCommand {
|
||||
name: "log-open",
|
||||
aliases: &[],
|
||||
doc: "Open the helix log file.",
|
||||
fun: open_log,
|
||||
completer: None,
|
||||
},
|
||||
TypableCommand {
|
||||
name: "pipe",
|
||||
aliases: &[],
|
||||
|
Loading…
Reference in New Issue
Block a user