feat: add keybindings for next/previous file in filelist_view (A-n/p)

This commit is contained in:
CJ van den Berg 2024-07-28 22:41:07 +02:00
parent 99b50dd3f5
commit 9a6c5baf8b
6 changed files with 52 additions and 21 deletions

View file

@ -141,8 +141,8 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) !void {
},
mod.ALT => switch (keynormal) {
'J' => self.cmd("join_next_line", .{}),
'N' => self.cmd("goto_next_diagnostic", .{}),
'P' => self.cmd("goto_prev_diagnostic", .{}),
'N' => self.cmd("goto_next_file_or_diagnostic", .{}),
'P' => self.cmd("goto_prev_file_or_diagnostic", .{}),
'U' => self.cmd("to_upper", .{}),
'L' => self.cmd("to_lower", .{}),
'I' => self.cmd("toggle_inputview", .{}),
@ -336,9 +336,9 @@ const hints = tui.KeybindHints.initComptime(.{
// .{ "filter", "S-A-s" }, // self.cmd("filter", command.fmt(.{ "sort", "-u" })),
.{ "format", "S-A-f" },
.{ "goto_definition", "F12" },
.{ "goto_next_diagnostic", "A-n" },
.{ "goto_next_file_or_diagnostic", "A-n" },
.{ "goto_next_match", "C-n, F3" },
.{ "goto_prev_diagnostic", "A-p" },
.{ "goto_prev_file_or_diagnostic", "A-p" },
.{ "goto_prev_match", "C-p, S-F3" },
.{ "gutter_mode_next", "A-F10" },
.{ "indent", "tab" },

View file

@ -523,9 +523,9 @@ const hints = tui.KeybindHints.initComptime(.{
// .{ "filter", "S-A-s" }, // self.cmd("filter", command.fmt(.{ "sort", "-u" })),
.{ "format", "S-A-f" },
.{ "goto_definition", "F12" },
.{ "goto_next_diagnostic", "A-n" },
.{ "goto_next_file_or_diagnostic", "A-n" },
.{ "goto_next_match", "C-n, F3, n" },
.{ "goto_prev_diagnostic", "A-p" },
.{ "goto_prev_file_or_diagnostic", "A-p" },
.{ "goto_prev_match", "C-p, S-F3, N" },
.{ "gutter_mode_next", "A-F10" },
.{ "indent", "tab" },

View file

@ -483,9 +483,9 @@ const hints = tui.KeybindHints.initComptime(.{
// .{ "filter", "S-A-s" }, // self.cmd("filter", command.fmt(.{ "sort", "-u" })),
.{ "format", "S-A-f" },
.{ "goto_definition", "F12" },
.{ "goto_next_diagnostic", "A-n" },
.{ "goto_next_file_or_diagnostic", "A-n" },
.{ "goto_next_match", "C-n, F3, n" },
.{ "goto_prev_diagnostic", "A-p" },
.{ "goto_prev_file_or_diagnostic", "A-p" },
.{ "goto_prev_match", "C-p, S-F3, N" },
.{ "gutter_mode_next", "A-F10" },
.{ "indent", "tab" },

View file

@ -108,8 +108,8 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) !void {
},
mod.ALT => switch (keynormal) {
'V' => self.cmd("system_paste", .{}),
'N' => self.cmd("goto_next_match", .{}),
'P' => self.cmd("goto_prev_match", .{}),
'N' => self.cmd("goto_next_file", .{}),
'P' => self.cmd("goto_prev_file", .{}),
else => {},
},
mod.ALT | mod.SHIFT => switch (keynormal) {