From 37eb4082fe2fd5d4592d11fb529e56d41642f7cd Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 25 Jun 2024 10:10:52 -0700 Subject: [PATCH] config: reorder increase font size so it works on macOS menu Fixes #1826 --- src/config/Config.zig | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/config/Config.zig b/src/config/Config.zig index 6e10e63fb..619327763 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -1199,18 +1199,21 @@ pub fn default(alloc_gpa: Allocator) Allocator.Error!Config { ); } - // Fonts - try result.keybind.set.put( - alloc, - .{ .key = .{ .translated = .equal }, .mods = inputpkg.ctrlOrSuper(.{}) }, - .{ .increase_font_size = 1 }, - ); // Increase font size mapping for keyboards with dedicated plus keys (like german) + // Note: this order matters below because the C API will only return + // the last keybinding for a given action. The macOS app uses this to + // set the expected keybind for the menu. try result.keybind.set.put( alloc, .{ .key = .{ .translated = .plus }, .mods = inputpkg.ctrlOrSuper(.{}) }, .{ .increase_font_size = 1 }, ); + try result.keybind.set.put( + alloc, + .{ .key = .{ .translated = .equal }, .mods = inputpkg.ctrlOrSuper(.{}) }, + .{ .increase_font_size = 1 }, + ); + try result.keybind.set.put( alloc, .{ .key = .{ .translated = .minus }, .mods = inputpkg.ctrlOrSuper(.{}) },