mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-16 14:56:10 +00:00
config: make split/tab navigation keybinds performable (#7683)
Fixes #7680
This commit is contained in:
@@ -4962,25 +4962,29 @@ pub const Keybinds = struct {
|
|||||||
.{ .key = .{ .unicode = 'w' }, .mods = .{ .ctrl = true, .shift = true } },
|
.{ .key = .{ .unicode = 'w' }, .mods = .{ .ctrl = true, .shift = true } },
|
||||||
.{ .close_tab = {} },
|
.{ .close_tab = {} },
|
||||||
);
|
);
|
||||||
try self.set.put(
|
try self.set.putFlags(
|
||||||
alloc,
|
alloc,
|
||||||
.{ .key = .{ .physical = .arrow_left }, .mods = .{ .ctrl = true, .shift = true } },
|
.{ .key = .{ .physical = .arrow_left }, .mods = .{ .ctrl = true, .shift = true } },
|
||||||
.{ .previous_tab = {} },
|
.{ .previous_tab = {} },
|
||||||
|
.{ .performable = true },
|
||||||
);
|
);
|
||||||
try self.set.put(
|
try self.set.putFlags(
|
||||||
alloc,
|
alloc,
|
||||||
.{ .key = .{ .physical = .arrow_right }, .mods = .{ .ctrl = true, .shift = true } },
|
.{ .key = .{ .physical = .arrow_right }, .mods = .{ .ctrl = true, .shift = true } },
|
||||||
.{ .next_tab = {} },
|
.{ .next_tab = {} },
|
||||||
|
.{ .performable = true },
|
||||||
);
|
);
|
||||||
try self.set.put(
|
try self.set.putFlags(
|
||||||
alloc,
|
alloc,
|
||||||
.{ .key = .{ .physical = .page_up }, .mods = .{ .ctrl = true } },
|
.{ .key = .{ .physical = .page_up }, .mods = .{ .ctrl = true } },
|
||||||
.{ .previous_tab = {} },
|
.{ .previous_tab = {} },
|
||||||
|
.{ .performable = true },
|
||||||
);
|
);
|
||||||
try self.set.put(
|
try self.set.putFlags(
|
||||||
alloc,
|
alloc,
|
||||||
.{ .key = .{ .physical = .page_down }, .mods = .{ .ctrl = true } },
|
.{ .key = .{ .physical = .page_down }, .mods = .{ .ctrl = true } },
|
||||||
.{ .next_tab = {} },
|
.{ .next_tab = {} },
|
||||||
|
.{ .performable = true },
|
||||||
);
|
);
|
||||||
try self.set.put(
|
try self.set.put(
|
||||||
alloc,
|
alloc,
|
||||||
@@ -4992,57 +4996,67 @@ pub const Keybinds = struct {
|
|||||||
.{ .key = .{ .unicode = 'e' }, .mods = .{ .ctrl = true, .shift = true } },
|
.{ .key = .{ .unicode = 'e' }, .mods = .{ .ctrl = true, .shift = true } },
|
||||||
.{ .new_split = .down },
|
.{ .new_split = .down },
|
||||||
);
|
);
|
||||||
try self.set.put(
|
try self.set.putFlags(
|
||||||
alloc,
|
alloc,
|
||||||
.{ .key = .{ .physical = .bracket_left }, .mods = .{ .ctrl = true, .super = true } },
|
.{ .key = .{ .physical = .bracket_left }, .mods = .{ .ctrl = true, .super = true } },
|
||||||
.{ .goto_split = .previous },
|
.{ .goto_split = .previous },
|
||||||
|
.{ .performable = true },
|
||||||
);
|
);
|
||||||
try self.set.put(
|
try self.set.putFlags(
|
||||||
alloc,
|
alloc,
|
||||||
.{ .key = .{ .physical = .bracket_right }, .mods = .{ .ctrl = true, .super = true } },
|
.{ .key = .{ .physical = .bracket_right }, .mods = .{ .ctrl = true, .super = true } },
|
||||||
.{ .goto_split = .next },
|
.{ .goto_split = .next },
|
||||||
|
.{ .performable = true },
|
||||||
);
|
);
|
||||||
try self.set.put(
|
try self.set.putFlags(
|
||||||
alloc,
|
alloc,
|
||||||
.{ .key = .{ .physical = .arrow_up }, .mods = .{ .ctrl = true, .alt = true } },
|
.{ .key = .{ .physical = .arrow_up }, .mods = .{ .ctrl = true, .alt = true } },
|
||||||
.{ .goto_split = .up },
|
.{ .goto_split = .up },
|
||||||
|
.{ .performable = true },
|
||||||
);
|
);
|
||||||
try self.set.put(
|
try self.set.putFlags(
|
||||||
alloc,
|
alloc,
|
||||||
.{ .key = .{ .physical = .arrow_down }, .mods = .{ .ctrl = true, .alt = true } },
|
.{ .key = .{ .physical = .arrow_down }, .mods = .{ .ctrl = true, .alt = true } },
|
||||||
.{ .goto_split = .down },
|
.{ .goto_split = .down },
|
||||||
|
.{ .performable = true },
|
||||||
);
|
);
|
||||||
try self.set.put(
|
try self.set.putFlags(
|
||||||
alloc,
|
alloc,
|
||||||
.{ .key = .{ .physical = .arrow_left }, .mods = .{ .ctrl = true, .alt = true } },
|
.{ .key = .{ .physical = .arrow_left }, .mods = .{ .ctrl = true, .alt = true } },
|
||||||
.{ .goto_split = .left },
|
.{ .goto_split = .left },
|
||||||
|
.{ .performable = true },
|
||||||
);
|
);
|
||||||
try self.set.put(
|
try self.set.putFlags(
|
||||||
alloc,
|
alloc,
|
||||||
.{ .key = .{ .physical = .arrow_right }, .mods = .{ .ctrl = true, .alt = true } },
|
.{ .key = .{ .physical = .arrow_right }, .mods = .{ .ctrl = true, .alt = true } },
|
||||||
.{ .goto_split = .right },
|
.{ .goto_split = .right },
|
||||||
|
.{ .performable = true },
|
||||||
);
|
);
|
||||||
|
|
||||||
// Resizing splits
|
// Resizing splits
|
||||||
try self.set.put(
|
try self.set.putFlags(
|
||||||
alloc,
|
alloc,
|
||||||
.{ .key = .{ .physical = .arrow_up }, .mods = .{ .super = true, .ctrl = true, .shift = true } },
|
.{ .key = .{ .physical = .arrow_up }, .mods = .{ .super = true, .ctrl = true, .shift = true } },
|
||||||
.{ .resize_split = .{ .up, 10 } },
|
.{ .resize_split = .{ .up, 10 } },
|
||||||
|
.{ .performable = true },
|
||||||
);
|
);
|
||||||
try self.set.put(
|
try self.set.putFlags(
|
||||||
alloc,
|
alloc,
|
||||||
.{ .key = .{ .physical = .arrow_down }, .mods = .{ .super = true, .ctrl = true, .shift = true } },
|
.{ .key = .{ .physical = .arrow_down }, .mods = .{ .super = true, .ctrl = true, .shift = true } },
|
||||||
.{ .resize_split = .{ .down, 10 } },
|
.{ .resize_split = .{ .down, 10 } },
|
||||||
|
.{ .performable = true },
|
||||||
);
|
);
|
||||||
try self.set.put(
|
try self.set.putFlags(
|
||||||
alloc,
|
alloc,
|
||||||
.{ .key = .{ .physical = .arrow_left }, .mods = .{ .super = true, .ctrl = true, .shift = true } },
|
.{ .key = .{ .physical = .arrow_left }, .mods = .{ .super = true, .ctrl = true, .shift = true } },
|
||||||
.{ .resize_split = .{ .left, 10 } },
|
.{ .resize_split = .{ .left, 10 } },
|
||||||
|
.{ .performable = true },
|
||||||
);
|
);
|
||||||
try self.set.put(
|
try self.set.putFlags(
|
||||||
alloc,
|
alloc,
|
||||||
.{ .key = .{ .physical = .arrow_right }, .mods = .{ .super = true, .ctrl = true, .shift = true } },
|
.{ .key = .{ .physical = .arrow_right }, .mods = .{ .super = true, .ctrl = true, .shift = true } },
|
||||||
.{ .resize_split = .{ .right, 10 } },
|
.{ .resize_split = .{ .right, 10 } },
|
||||||
|
.{ .performable = true },
|
||||||
);
|
);
|
||||||
|
|
||||||
// Viewport scrolling
|
// Viewport scrolling
|
||||||
@@ -5113,22 +5127,24 @@ pub const Keybinds = struct {
|
|||||||
const end: u21 = '8';
|
const end: u21 = '8';
|
||||||
var i: u21 = start;
|
var i: u21 = start;
|
||||||
while (i <= end) : (i += 1) {
|
while (i <= end) : (i += 1) {
|
||||||
try self.set.put(
|
try self.set.putFlags(
|
||||||
alloc,
|
alloc,
|
||||||
.{
|
.{
|
||||||
.key = .{ .unicode = i },
|
.key = .{ .unicode = i },
|
||||||
.mods = mods,
|
.mods = mods,
|
||||||
},
|
},
|
||||||
.{ .goto_tab = (i - start) + 1 },
|
.{ .goto_tab = (i - start) + 1 },
|
||||||
|
.{ .performable = true },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
try self.set.put(
|
try self.set.putFlags(
|
||||||
alloc,
|
alloc,
|
||||||
.{
|
.{
|
||||||
.key = .{ .unicode = '9' },
|
.key = .{ .unicode = '9' },
|
||||||
.mods = mods,
|
.mods = mods,
|
||||||
},
|
},
|
||||||
.{ .last_tab = {} },
|
.{ .last_tab = {} },
|
||||||
|
.{ .performable = true },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user