From c02dcbaa080e0a437be448a7463536624b151ce4 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 22 Oct 2024 19:32:06 +0200 Subject: [PATCH] feat: use undo instead of delete_backward to revert initial chord keystroke --- src/tui/mode/input/vim/insert.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tui/mode/input/vim/insert.zig b/src/tui/mode/input/vim/insert.zig index 6407b68..5460625 100644 --- a/src/tui/mode/input/vim/insert.zig +++ b/src/tui/mode/input/vim/insert.zig @@ -102,22 +102,22 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) !void { //chording if (self.last_key.keypress == 'j' and self.last_key.modifiers == 0 and keypress == 'k' and modifiers == 0) { - try self.cmd("delete_backward", .{}); + try self.cmd("undo", .{}); try self.cmd("enter_mode", command.fmt(.{"vim/normal"})); return; } if (self.last_key.keypress == 'k' and self.last_key.modifiers == 0 and keypress == 'j' and modifiers == 0) { - try self.cmd("delete_backward", .{}); + try self.cmd("undo", .{}); try self.cmd("enter_mode", command.fmt(.{"vim/normal"})); return; } if (self.last_key.keypress == 'f' and self.last_key.modifiers == 0 and keypress == 'j' and modifiers == 0) { - try self.cmd("delete_backward", .{}); + try self.cmd("undo", .{}); try self.cmd("enter_mode", command.fmt(.{"vim/normal"})); return; } if (self.last_key.keypress == 'j' and self.last_key.modifiers == 0 and keypress == 'f' and modifiers == 0) { - try self.cmd("delete_backward", .{}); + try self.cmd("undo", .{}); try self.cmd("enter_mode", command.fmt(.{"vim/normal"})); return; }