mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
Merge pull request #2856 from ghostty-org/push-nmsumxnrsyrq
macos: unicode keybindings must convert to string properly
This commit is contained in:
@ -50,7 +50,8 @@ extension Ghostty {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case GHOSTTY_TRIGGER_UNICODE:
|
case GHOSTTY_TRIGGER_UNICODE:
|
||||||
equiv = String(trigger.key.unicode)
|
guard let scalar = UnicodeScalar(trigger.key.unicode) else { return nil }
|
||||||
|
equiv = String(scalar)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return nil
|
return nil
|
||||||
|
@ -1454,21 +1454,30 @@ pub const Set = struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// If we have any leaders we need to clone them.
|
// If we have any leaders we need to clone them.
|
||||||
var it = result.bindings.iterator();
|
{
|
||||||
while (it.next()) |entry| switch (entry.value_ptr.*) {
|
var it = result.bindings.iterator();
|
||||||
// Leaves could have data to clone (i.e. text actions
|
while (it.next()) |entry| switch (entry.value_ptr.*) {
|
||||||
// contain allocated strings).
|
// Leaves could have data to clone (i.e. text actions
|
||||||
.leaf => |*s| s.* = try s.clone(alloc),
|
// contain allocated strings).
|
||||||
|
.leaf => |*s| s.* = try s.clone(alloc),
|
||||||
|
|
||||||
// Must be deep cloned.
|
// Must be deep cloned.
|
||||||
.leader => |*s| {
|
.leader => |*s| {
|
||||||
const ptr = try alloc.create(Set);
|
const ptr = try alloc.create(Set);
|
||||||
errdefer alloc.destroy(ptr);
|
errdefer alloc.destroy(ptr);
|
||||||
ptr.* = try s.*.clone(alloc);
|
ptr.* = try s.*.clone(alloc);
|
||||||
errdefer ptr.deinit(alloc);
|
errdefer ptr.deinit(alloc);
|
||||||
s.* = ptr;
|
s.* = ptr;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// We need to clone the action keys in the reverse map since
|
||||||
|
// they may contain allocated values.
|
||||||
|
{
|
||||||
|
var it = result.reverse.keyIterator();
|
||||||
|
while (it.next()) |action| action.* = try action.clone(alloc);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user