terminal: relax grapheme integrity check for fast paths

This commit is contained in:
Mitchell Hashimoto
2024-03-21 22:00:07 -07:00
parent f848ed2a63
commit 0bc831d19f
3 changed files with 4 additions and 3 deletions

View File

@ -56,7 +56,7 @@ pub const Attribute = sgr.Attribute;
test {
@import("std").testing.refAllDecls(@This());
// todo: make top-level imports
// Internals
_ = @import("bitmap_allocator.zig");
_ = @import("hash_map.zig");
_ = @import("size.zig");

View File

@ -207,6 +207,8 @@ pub const Page = struct {
// trim rows without clearing data.
// - We do not check that styles seen is exactly the same as the
// styles count in the page for the same reason as above.
// - We only check that we saw less graphemes than the total memory
// used for the same reason as styles above.
//
var arena = ArenaAllocator.init(alloc_gpa);
@ -279,7 +281,7 @@ pub const Page = struct {
}
// Our graphemes seen should exactly match the grapheme count
if (graphemes_seen != self.graphemeCount()) {
if (graphemes_seen > self.graphemeCount()) {
log.warn(
"page integrity violation grapheme count mismatch expected={} actual={}",
.{ graphemes_seen, self.graphemeCount() },

View File

@ -232,7 +232,6 @@ pub const Set = struct {
/// No more available IDs. Perform a garbage collection
/// operation to compact ID space.
/// TODO: implement gc operation
Overflow,
};