mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 00:36:07 +03:00
terminal: do not attach grapheme to empty cell
This commit is contained in:
@ -648,7 +648,7 @@ pub fn print(self: *Terminal, c: u21) !void {
|
|||||||
if (c > 255 and
|
if (c > 255 and
|
||||||
self.modes.get(.grapheme_cluster) and
|
self.modes.get(.grapheme_cluster) and
|
||||||
self.screen.cursor.x > 0)
|
self.screen.cursor.x > 0)
|
||||||
{
|
grapheme: {
|
||||||
const row = self.screen.getRow(.{ .active = self.screen.cursor.y });
|
const row = self.screen.getRow(.{ .active = self.screen.cursor.y });
|
||||||
|
|
||||||
// We need the previous cell to determine if we're at a grapheme
|
// We need the previous cell to determine if we're at a grapheme
|
||||||
@ -673,6 +673,10 @@ pub fn print(self: *Terminal, c: u21) !void {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// If our cell has no content, then this is a new cell and
|
||||||
|
// necessarily a grapheme break.
|
||||||
|
if (prev.cell.char == 0) break :grapheme;
|
||||||
|
|
||||||
const grapheme_break = brk: {
|
const grapheme_break = brk: {
|
||||||
var state: i32 = 0;
|
var state: i32 = 0;
|
||||||
var cp1 = @as(u21, @intCast(prev.cell.char));
|
var cp1 = @as(u21, @intCast(prev.cell.char));
|
||||||
|
Reference in New Issue
Block a user