mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-25 13:16:11 +03:00
terminal: add more assertions
This commit is contained in:
@ -412,6 +412,8 @@ pub const Row = struct {
|
|||||||
|
|
||||||
/// Attach a grapheme codepoint to the given cell.
|
/// Attach a grapheme codepoint to the given cell.
|
||||||
pub fn attachGrapheme(self: Row, x: usize, cp: u21) !void {
|
pub fn attachGrapheme(self: Row, x: usize, cp: u21) !void {
|
||||||
|
assert(x < self.storage.len - 1);
|
||||||
|
|
||||||
const cell = &self.storage[x + 1].cell;
|
const cell = &self.storage[x + 1].cell;
|
||||||
const key = self.getId() + x + 1;
|
const key = self.getId() + x + 1;
|
||||||
const gop = try self.screen.graphemes.getOrPut(self.screen.alloc, key);
|
const gop = try self.screen.graphemes.getOrPut(self.screen.alloc, key);
|
||||||
@ -448,6 +450,8 @@ pub const Row = struct {
|
|||||||
|
|
||||||
/// Removes all graphemes associated with a cell.
|
/// Removes all graphemes associated with a cell.
|
||||||
pub fn clearGraphemes(self: Row, x: usize) void {
|
pub fn clearGraphemes(self: Row, x: usize) void {
|
||||||
|
assert(x < self.storage.len - 1);
|
||||||
|
|
||||||
// Our row is now dirty
|
// Our row is now dirty
|
||||||
self.storage[0].header.flags.dirty = true;
|
self.storage[0].header.flags.dirty = true;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user