Skip to content

Commit c0baff5

Browse files
amaihoefnermtoohey31
authored andcommitted
feat(commands): add log-open command (helix-editor#2422)
1 parent 28146fc commit c0baff5

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

book/src/generated/typable-cmd.md

+1
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,6 @@
6363
| `:tree-sitter-subtree`, `:ts-subtree` | Display tree sitter subtree under cursor, primarily for debugging queries. |
6464
| `:config-reload` | Refreshes helix's config. |
6565
| `:config-open` | Open the helix config.toml file. |
66+
| `:log-open` | Open the helix log file. |
6667
| `:pipe` | Pipe each selection to the shell command. |
6768
| `:run-shell-command`, `:sh` | Run a shell command |

helix-term/src/commands/typed.rs

+16
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,15 @@ fn open_config(
11461146
Ok(())
11471147
}
11481148

1149+
fn open_log(
1150+
cx: &mut compositor::Context,
1151+
_args: &[Cow<str>],
1152+
_event: PromptEvent,
1153+
) -> anyhow::Result<()> {
1154+
cx.editor.open(helix_loader::log_file(), Action::Replace)?;
1155+
Ok(())
1156+
}
1157+
11491158
fn refresh_config(
11501159
cx: &mut compositor::Context,
11511160
_args: &[Cow<str>],
@@ -1647,6 +1656,13 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
16471656
fun: open_config,
16481657
completer: None,
16491658
},
1659+
TypableCommand {
1660+
name: "log-open",
1661+
aliases: &[],
1662+
doc: "Open the helix log file.",
1663+
fun: open_log,
1664+
completer: None,
1665+
},
16501666
TypableCommand {
16511667
name: "pipe",
16521668
aliases: &[],

0 commit comments

Comments
 (0)