mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 16:26:08 +03:00
Merge pull request #2434 from ofseed/en-space
renderer: generalize the definition of "space"
This commit is contained in:
@ -101,7 +101,7 @@ pub fn fgMode(
|
|||||||
break :next_cp next_cell.codepoint();
|
break :next_cp next_cell.codepoint();
|
||||||
};
|
};
|
||||||
if (next_cp == 0 or
|
if (next_cp == 0 or
|
||||||
next_cp == ' ' or
|
isSpace(next_cp) or
|
||||||
isPowerline(next_cp))
|
isPowerline(next_cp))
|
||||||
{
|
{
|
||||||
break :text .normal;
|
break :text .normal;
|
||||||
@ -113,6 +113,17 @@ pub fn fgMode(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Some general spaces, others intentionally kept
|
||||||
|
// to force the font to render as a fixed width.
|
||||||
|
fn isSpace(char: u21) bool {
|
||||||
|
return switch (char) {
|
||||||
|
0x0020, // SPACE
|
||||||
|
0x2002, // EN SPACE
|
||||||
|
=> true,
|
||||||
|
else => false,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Returns true if the codepoint is a part of the Powerline range.
|
// Returns true if the codepoint is a part of the Powerline range.
|
||||||
fn isPowerline(char: u21) bool {
|
fn isPowerline(char: u21) bool {
|
||||||
return switch (char) {
|
return switch (char) {
|
||||||
|
Reference in New Issue
Block a user