Fix jumpy characters in Konsole

When you do a selection, characters jump. This s a lot worse if
you enable "Underline Files" as then characters are jumping all the
time.

Example of such characters are, icon chars from the result of `ls-deluxe` or
`exa`.
wilder
Waqar Ahmed 4 years ago committed by Tomaz Canabrava
parent a35991306c
commit 60b0c9d526
  1. 17
      src/terminalDisplay/TerminalPainter.cpp

@ -142,6 +142,23 @@ void TerminalPainter::drawContents(Character *image,
break;
}
// Group spaces following any non-wide character with the character. This allows for
// 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
len++;
while (isInsideDrawArea(x + len)) {
const Character next_char = image[display->loc(x + len, y)];
if (next_char.character == ' ' && char_value.hasSameColors(next_char) && char_value.hasSameRendition(next_char)) {
len++;
} else {
break;
}
}
break;
}
const uint c = next_char.character;
if ((next_char.rendition & RE_EXTENDED_CHAR) != 0) {
// sequence of characters

Loading…
Cancel
Save