mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
renderer: also constrain PUA chars if preceded by PUA
This commit is contained in:
@ -45,14 +45,24 @@ pub fn fgMode(
|
|||||||
break :text .normal;
|
break :text .normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we are at the end of the screen its definitely constrained
|
||||||
|
if (x == screen.cols - 1) break :text .constrained;
|
||||||
|
|
||||||
|
// If we have a previous cell and it was PUA then we need to
|
||||||
|
// also constrain. This is so that multiple PUA glyphs align.
|
||||||
|
if (x > 0) {
|
||||||
|
const prev_cell = screen.getCell(.active, y, x - 1);
|
||||||
|
if (ziglyph.general_category.isPrivateUse(@intCast(prev_cell.char))) {
|
||||||
|
break :text .constrained;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If the next cell is empty, then we allow it to use the
|
// If the next cell is empty, then we allow it to use the
|
||||||
// full glyph size.
|
// full glyph size.
|
||||||
if (x < screen.cols - 1) {
|
|
||||||
const next_cell = screen.getCell(.active, y, x + 1);
|
const next_cell = screen.getCell(.active, y, x + 1);
|
||||||
if (next_cell.char == 0 or next_cell.char == ' ') {
|
if (next_cell.char == 0 or next_cell.char == ' ') {
|
||||||
break :text .normal;
|
break :text .normal;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Must be constrained
|
// Must be constrained
|
||||||
break :text .constrained;
|
break :text .constrained;
|
||||||
|
Reference in New Issue
Block a user