Skip to content

Commit

Permalink
Update control keys so that ctrl-p goes up
Browse files Browse the repository at this point in the history
Expected behavior of ctrl-p is to move up a line but instead it was
moving down.

I frequently use emacs shortcuts for moving up and down lines and I
noticed this. Made a single change so that it works as expected now.
  • Loading branch information
joshdpark authored and natecraddock committed Oct 12, 2024
1 parent eefcf2a commit 1f5efbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tui/ui.zig
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ pub const State = struct {
state.query.moveCursor(1, .right);
} else if (key.matches('b', .{ .ctrl = true }) or key.matches(Key.left, .{})) {
state.query.moveCursor(1, .left);
} else if (key.matches(Key.down, .{}) or key.matches('p', .{ .ctrl = true }) or key.matches('n', .{ .ctrl = true })) {
} else if (key.matches(Key.down, .{}) or key.matches('n', .{ .ctrl = true })) {
lineDown(state, visible_rows, num_filtered - visible_rows);
} else if (key.matches(Key.up, .{})) {
} else if (key.matches(Key.up, .{}) or key.matches('p', .{ .ctrl = true })) {
lineUp(state);
} else if (key.matches('k', .{ .ctrl = true })) {
if (state.config.vi_mode) lineUp(state) else state.query.deleteTo(state.query.len());
Expand Down

0 comments on commit 1f5efbe

Please sign in to comment.