From d339ac77d360ba14e4174a0b62c89c1caae00b78 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 23 May 2024 20:47:24 +0200 Subject: [PATCH] fix(vaxis): add vaxis compatible keybindings for modified F keys --- src/tui/mode/input/flow.zig | 3 +++ src/tui/mode/input/vim/insert.zig | 3 +++ src/tui/mode/input/vim/normal.zig | 3 +++ src/tui/mode/input/vim/visual.zig | 3 +++ 4 files changed, 12 insertions(+) diff --git a/src/tui/mode/input/flow.zig b/src/tui/mode/input/flow.zig index 163df1f..1ad55fd 100644 --- a/src/tui/mode/input/flow.zig +++ b/src/tui/mode/input/flow.zig @@ -115,6 +115,8 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) tp.result { key.RIGHT => self.cmd("move_word_right", .{}), key.BACKSPACE => self.cmd("delete_word_left", .{}), key.DEL => self.cmd("delete_word_right", .{}), + key.F05 => self.cmd("toggle_inspector_view", .{}), + key.F10 => self.cmd("toggle_whitespace", .{}), // aka F34 else => {}, }, mod.CTRL | mod.SHIFT => switch (keynormal) { @@ -152,6 +154,7 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) tp.result { key.UP => self.cmd("pull_up", .{}), key.DOWN => self.cmd("pull_down", .{}), key.ENTER => self.cmd("insert_line", .{}), + key.F10 => self.cmd("gutter_mode_next", .{}), // aka F58 else => {}, }, mod.ALT | mod.SHIFT => switch (keynormal) { diff --git a/src/tui/mode/input/vim/insert.zig b/src/tui/mode/input/vim/insert.zig index cfd3ae1..ad90150 100644 --- a/src/tui/mode/input/vim/insert.zig +++ b/src/tui/mode/input/vim/insert.zig @@ -118,6 +118,8 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) tp.result { key.RIGHT => self.cmd("move_word_right", .{}), key.BACKSPACE => self.cmd("delete_word_left", .{}), key.DEL => self.cmd("delete_word_right", .{}), + key.F05 => self.cmd("toggle_inspector_view", .{}), + key.F10 => self.cmd("toggle_whitespace", .{}), // aka F34 else => {}, }, mod.CTRL | mod.SHIFT => switch (keynormal) { @@ -155,6 +157,7 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) tp.result { key.UP => self.cmd("pull_up", .{}), key.DOWN => self.cmd("pull_down", .{}), key.ENTER => self.cmd("insert_line", .{}), + key.F10 => self.cmd("gutter_mode_next", .{}), // aka F58 else => {}, }, mod.ALT | mod.SHIFT => switch (keynormal) { diff --git a/src/tui/mode/input/vim/normal.zig b/src/tui/mode/input/vim/normal.zig index aa91ecc..d72d855 100644 --- a/src/tui/mode/input/vim/normal.zig +++ b/src/tui/mode/input/vim/normal.zig @@ -121,6 +121,8 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) tp.result { key.RIGHT => self.cmd("move_word_right", .{}), key.BACKSPACE => self.cmd("delete_word_left", .{}), key.DEL => self.cmd("delete_word_right", .{}), + key.F05 => self.cmd("toggle_inspector_view", .{}), + key.F10 => self.cmd("toggle_whitespace", .{}), // aka F34 else => {}, }, mod.CTRL | mod.SHIFT => switch (keynormal) { @@ -158,6 +160,7 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) tp.result { key.UP => self.cmd("pull_up", .{}), key.DOWN => self.cmd("pull_down", .{}), key.ENTER => self.cmd("insert_line", .{}), + key.F10 => self.cmd("gutter_mode_next", .{}), // aka F58 else => {}, }, mod.ALT | mod.SHIFT => switch (keynormal) { diff --git a/src/tui/mode/input/vim/visual.zig b/src/tui/mode/input/vim/visual.zig index f2d7eb2..c0db986 100644 --- a/src/tui/mode/input/vim/visual.zig +++ b/src/tui/mode/input/vim/visual.zig @@ -121,6 +121,8 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) tp.result { key.RIGHT => self.cmd("select_word_right", .{}), key.BACKSPACE => self.cmd("delete_word_left", .{}), key.DEL => self.cmd("delete_word_right", .{}), + key.F05 => self.cmd("toggle_inspector_view", .{}), + key.F10 => self.cmd("toggle_whitespace", .{}), // aka F34 else => {}, }, mod.CTRL | mod.SHIFT => switch (keynormal) { @@ -158,6 +160,7 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) tp.result { key.UP => self.cmd("pull_up", .{}), key.DOWN => self.cmd("pull_down", .{}), key.ENTER => self.cmd("insert_line", .{}), + key.F10 => self.cmd("gutter_mode_next", .{}), // aka F58 else => {}, }, mod.ALT | mod.SHIFT => switch (keynormal) {