mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
fix: NoSpaceLeft => OutOfMemory
NoSpaceLeft is not permitted to be returned in this context, so turn it into OutOfMemory when we fail to write to the buffer.
This commit is contained in:
@ -4214,7 +4214,7 @@ pub const Keybinds = struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var buffer_stream = std.io.fixedBufferStream(&buf);
|
var buffer_stream = std.io.fixedBufferStream(&buf);
|
||||||
try std.fmt.format(buffer_stream.writer(), "{}", .{k});
|
std.fmt.format(buffer_stream.writer(), "{}", .{k}) catch return error.OutOfMemory;
|
||||||
try v.formatEntries(&buffer_stream, formatter);
|
try v.formatEntries(&buffer_stream, formatter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1171,7 +1171,7 @@ pub const Set = struct {
|
|||||||
var iter = set.bindings.iterator();
|
var iter = set.bindings.iterator();
|
||||||
while (iter.next()) |binding| {
|
while (iter.next()) |binding| {
|
||||||
buffer_stream.seekTo(pos) catch unreachable; // can't fail
|
buffer_stream.seekTo(pos) catch unreachable; // can't fail
|
||||||
try std.fmt.format(buffer_stream.writer(), ">{s}", .{binding.key_ptr.*});
|
std.fmt.format(buffer_stream.writer(), ">{s}", .{binding.key_ptr.*}) catch return error.OutOfMemory;
|
||||||
try binding.value_ptr.*.formatEntries(buffer_stream, formatter);
|
try binding.value_ptr.*.formatEntries(buffer_stream, formatter);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1179,7 +1179,7 @@ pub const Set = struct {
|
|||||||
.leaf => |leaf| {
|
.leaf => |leaf| {
|
||||||
// When we get to the leaf, the buffer_stream contains
|
// When we get to the leaf, the buffer_stream contains
|
||||||
// the full sequence of keys needed to reach this action.
|
// the full sequence of keys needed to reach this action.
|
||||||
try std.fmt.format(buffer_stream.writer(), "={s}", .{leaf.action});
|
std.fmt.format(buffer_stream.writer(), "={s}", .{leaf.action}) catch return error.OutOfMemory;
|
||||||
try formatter.formatEntry([]const u8, buffer_stream.getWritten());
|
try formatter.formatEntry([]const u8, buffer_stream.getWritten());
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user