Commit 1d6da99c authored by Luis Javier Merino's avatar Luis Javier Merino Committed by Tomaz Canabrava
Browse files

Fix underline gaps in space characters

It turns out that trailing spaces _are_ significant, e.g. when the
current rendition is set to underline.  Gaps where appearing in
underlined text with spaces.  To test, launch konsole with -p
BidiRenderingEnabled=false, and run:

printf '\e[4mtest under  line    foo  ññññ  ááá  ééé  '

which should show no gaps in underlining, and exercises both instances
of the "group non-wide characters with following spaces" code.
parent 27046e54
Pipeline #188469 passed with stage
in 2 minutes and 22 seconds
......@@ -146,11 +146,12 @@ void TerminalPainter::drawContents(Character *image,
// rendering ambiguous characters with wide glyphs without clipping them.
// NOTE: This happens in the else case too, but we need it here as well.
if (!doubleWidth && next_char.character == ' ' && char_value.equalsFormat(next_char)) {
// univec intentionally not modified - trailing spaces are meaningless
univec << next_char.character;
len++;
while (isInsideDrawArea(x + len)) {
const Character next_char_gp = image[m_parentDisplay->loc(x + len, y)];
if (next_char_gp.character == ' ' && char_value.hasSameColors(next_char_gp) && char_value.hasSameRendition(next_char_gp)) {
univec << next_char_gp.character;
len++;
} else {
break;
......@@ -188,7 +189,7 @@ void TerminalPainter::drawContents(Character *image,
while (!doubleWidth && isInsideDrawArea(x + len)) {
const Character next_char = image[m_parentDisplay->loc(x + len, y)];
if (next_char.character == ' ' && char_value.hasSameColors(next_char) && char_value.hasSameRendition(next_char)) {
// univec intentionally not modified - trailing spaces are meaningless
univec << next_char.character;
len++;
} else {
// break otherwise, we don't want to be stuck in this loop
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment