feat: add open_recent_project and change_project commands

This commit is contained in:
CJ van den Berg 2024-08-19 20:35:05 +02:00
parent 2d9e66b534
commit 231e4ccb88
8 changed files with 177 additions and 10 deletions

View file

@ -81,6 +81,7 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) !void {
return switch (modifiers) {
mod.CTRL => switch (keynormal) {
'E' => self.cmd("open_recent", .{}),
'R' => self.cmd("open_recent_project", .{}),
'J' => self.cmd("toggle_panel", .{}),
'Z' => self.cmd("undo", .{}),
'Y' => self.cmd("redo", .{}),
@ -369,6 +370,7 @@ const hints = tui.KeybindHints.initComptime(.{
.{ "move_word_right", "C-right, A-f" },
.{ "open_command_palette", "C-S-p, S-A-p" },
.{ "open_recent", "C-e" },
.{ "open_recent_project", "C-r" },
.{ "paste", "A-v" },
.{ "pop_cursor", "C-u" },
.{ "pull_down", "A-down" },

View file

@ -63,6 +63,7 @@ fn mapPress(self: *Self, keypress: u32, modifiers: u32) tp.result {
'W' => self.cmd("quit", .{}),
'O' => self.cmd("open_file", .{}),
'E' => self.cmd("open_recent", .{}),
'R' => self.cmd("open_recent_project", .{}),
'P' => self.cmd("open_command_palette", .{}),
'/' => self.cmd("open_help", .{}),
'K' => self.leader = .{ .keypress = keynormal, .modifiers = modifiers },
@ -94,7 +95,7 @@ fn mapPress(self: *Self, keypress: u32, modifiers: u32) tp.result {
'h' => self.cmd("open_help", .{}),
'o' => self.cmd("open_file", .{}),
'e' => self.cmd("open_recent", .{}),
'r' => self.msg("open recent project not implemented"),
'r' => self.cmd("open_recent_project", .{}),
'p' => self.cmd("open_command_palette", .{}),
'c' => self.cmd("open_config", .{}),
't' => self.cmd("change_theme", .{}),
@ -157,6 +158,7 @@ const hints = tui.KeybindHints.initComptime(.{
.{ "find_in_files", "C-S-f" },
.{ "open_file", "o, C-o" },
.{ "open_recent", "e, C-e" },
.{ "open_recent_project", "r, C-r" },
.{ "open_command_palette", "p, C-S-p, S-A-p" },
.{ "home_menu_activate", "enter" },
.{ "home_menu_down", "down" },