Rename goto_split top/bottom directions to up/down.

This commit is contained in:
Daniel Patterson
2024-12-27 14:44:33 +00:00
parent a8e5eef11c
commit a4daabb28a
9 changed files with 27 additions and 27 deletions

View File

@ -375,9 +375,9 @@ typedef enum {
typedef enum {
GHOSTTY_GOTO_SPLIT_PREVIOUS,
GHOSTTY_GOTO_SPLIT_NEXT,
GHOSTTY_GOTO_SPLIT_TOP,
GHOSTTY_GOTO_SPLIT_UP,
GHOSTTY_GOTO_SPLIT_LEFT,
GHOSTTY_GOTO_SPLIT_BOTTOM,
GHOSTTY_GOTO_SPLIT_DOWN,
GHOSTTY_GOTO_SPLIT_RIGHT,
} ghostty_action_goto_split_e;

View File

@ -358,8 +358,8 @@ class AppDelegate: NSObject,
syncMenuShortcut(config, action: "toggle_split_zoom", menuItem: self.menuZoomSplit)
syncMenuShortcut(config, action: "goto_split:previous", menuItem: self.menuPreviousSplit)
syncMenuShortcut(config, action: "goto_split:next", menuItem: self.menuNextSplit)
syncMenuShortcut(config, action: "goto_split:top", menuItem: self.menuSelectSplitAbove)
syncMenuShortcut(config, action: "goto_split:bottom", menuItem: self.menuSelectSplitBelow)
syncMenuShortcut(config, action: "goto_split:up", menuItem: self.menuSelectSplitAbove)
syncMenuShortcut(config, action: "goto_split:down", menuItem: self.menuSelectSplitBelow)
syncMenuShortcut(config, action: "goto_split:left", menuItem: self.menuSelectSplitLeft)
syncMenuShortcut(config, action: "goto_split:right", menuItem: self.menuSelectSplitRight)
syncMenuShortcut(config, action: "resize_split:up,10", menuItem: self.menuMoveSplitDividerUp)

View File

@ -536,11 +536,11 @@ class BaseTerminalController: NSWindowController,
}
@IBAction func splitMoveFocusAbove(_ sender: Any) {
splitMoveFocus(direction: .top)
splitMoveFocus(direction: .up)
}
@IBAction func splitMoveFocusBelow(_ sender: Any) {
splitMoveFocus(direction: .bottom)
splitMoveFocus(direction: .down)
}
@IBAction func splitMoveFocusLeft(_ sender: Any) {

View File

@ -64,10 +64,10 @@ extension Ghostty {
let node: SplitNode
switch (direction) {
case .previous, .top, .left:
case .previous, .up, .left:
node = container.bottomRight
case .next, .bottom, .right:
case .next, .down, .right:
node = container.topLeft
}

View File

@ -66,7 +66,7 @@ extension Ghostty {
/// An enum that is used for the directions that a split focus event can change.
enum SplitFocusDirection {
case previous, next, top, bottom, left, right
case previous, next, up, down, left, right
/// Initialize from a Ghostty API enum.
static func from(direction: ghostty_action_goto_split_e) -> Self? {
@ -77,11 +77,11 @@ extension Ghostty {
case GHOSTTY_GOTO_SPLIT_NEXT:
return .next
case GHOSTTY_GOTO_SPLIT_TOP:
return .top
case GHOSTTY_GOTO_SPLIT_UP:
return .up
case GHOSTTY_GOTO_SPLIT_BOTTOM:
return .bottom
case GHOSTTY_GOTO_SPLIT_DOWN:
return .down
case GHOSTTY_GOTO_SPLIT_LEFT:
return .left
@ -102,11 +102,11 @@ extension Ghostty {
case .next:
return GHOSTTY_GOTO_SPLIT_NEXT
case .top:
return GHOSTTY_GOTO_SPLIT_TOP
case .up:
return GHOSTTY_GOTO_SPLIT_UP
case .bottom:
return GHOSTTY_GOTO_SPLIT_BOTTOM
case .down:
return GHOSTTY_GOTO_SPLIT_DOWN
case .left:
return GHOSTTY_GOTO_SPLIT_LEFT

View File

@ -332,9 +332,9 @@ pub const GotoSplit = enum(c_int) {
previous,
next,
top,
up,
left,
bottom,
down,
right,
};

View File

@ -316,7 +316,7 @@ pub fn directionMap(self: *const Split, from: Side) DirectionMap {
// This behavior matches the behavior of macOS at the time of writing
// this. There is an open issue (#524) to make this depend on the
// actual physical location of the current split.
result.put(.top, prev.surface);
result.put(.up, prev.surface);
result.put(.left, prev.surface);
}
}
@ -324,7 +324,7 @@ pub fn directionMap(self: *const Split, from: Side) DirectionMap {
if (self.directionNext(from)) |next| {
result.put(.next, next.surface);
if (!next.wrapped) {
result.put(.bottom, next.surface);
result.put(.down, next.surface);
result.put(.right, next.surface);
}
}

View File

@ -2202,12 +2202,12 @@ pub fn default(alloc_gpa: Allocator) Allocator.Error!Config {
try result.keybind.set.put(
alloc,
.{ .key = .{ .translated = .up }, .mods = .{ .ctrl = true, .alt = true } },
.{ .goto_split = .top },
.{ .goto_split = .up },
);
try result.keybind.set.put(
alloc,
.{ .key = .{ .translated = .down }, .mods = .{ .ctrl = true, .alt = true } },
.{ .goto_split = .bottom },
.{ .goto_split = .down },
);
try result.keybind.set.put(
alloc,
@ -2465,12 +2465,12 @@ pub fn default(alloc_gpa: Allocator) Allocator.Error!Config {
try result.keybind.set.put(
alloc,
.{ .key = .{ .translated = .up }, .mods = .{ .super = true, .alt = true } },
.{ .goto_split = .top },
.{ .goto_split = .up },
);
try result.keybind.set.put(
alloc,
.{ .key = .{ .translated = .down }, .mods = .{ .super = true, .alt = true } },
.{ .goto_split = .bottom },
.{ .goto_split = .down },
);
try result.keybind.set.put(
alloc,

View File

@ -469,9 +469,9 @@ pub const Action = union(enum) {
previous,
next,
top,
up,
left,
bottom,
down,
right,
};