diff --git a/src/tui/home.zig b/src/tui/home.zig index 23d2ac3..7b437b6 100644 --- a/src/tui/home.zig +++ b/src/tui/home.zig @@ -89,12 +89,13 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool { fn render_hints(self: *Self, style_base: Widget.Theme.Style, style_text: Widget.Theme.Style, style_keybind: Widget.Theme.Style) void { const hint_text: [:0]const u8 = - \\Help ······················· :F1 / C-? - \\Open file ·················· :C-o - \\Open recent file ··(wip)···· :C-e / C-r - \\Show/Run commands ·(wip)···· :C-p / C-S-p - \\Open config file ··········· :F6 - \\Quit/Close ················· :C-q, C-w + \\Help ······················· :h + \\Open file ·················· :o + \\Open recent file ··(wip)···· :e + \\Open recent project ··(wip)· :r + \\Show/Run commands ·(wip)···· :p + \\Open config file ··········· :c + \\Quit/Close ················· :q \\ ; diff --git a/src/tui/mode/input/home.zig b/src/tui/mode/input/home.zig index ac04b39..e3cf9f5 100644 --- a/src/tui/mode/input/home.zig +++ b/src/tui/mode/input/home.zig @@ -75,6 +75,14 @@ fn mapPress(self: *Self, keypress: u32, modifiers: u32) tp.result { else => {}, }, 0 => switch (keypress) { + 'h' => self.cmd("open_help", .{}), + 'o' => self.cmd("enter_open_file_mode", .{}), + 'e' => self.msg("open recent file not implemented"), + 'r' => self.msg("open recent project not implemented"), + 'p' => self.msg("open command palette not implemented"), + 'c' => self.cmd("open_config", .{}), + 'q' => self.cmd("quit", .{}), + nc.key.F01 => self.cmd("open_help", .{}), nc.key.F06 => self.cmd("open_config", .{}), nc.key.F09 => self.cmd("theme_prev", .{}), @@ -91,6 +99,10 @@ fn cmd(_: *Self, name_: []const u8, ctx: command.Context) tp.result { try command.executeName(name_, ctx); } +fn msg(_: *Self, text: []const u8) tp.result { + return tp.self_pid().send(.{ "log", "home", text }); +} + fn cmd_async(_: *Self, name_: []const u8) tp.result { return tp.self_pid().send(.{ "cmd", name_ }); }