Commit 60b0c9d5 authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Tomaz Canabrava
Browse files

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`.
parent a3599130
Pipeline #179904 passed with stage
in 3 minutes and 24 seconds
......@@ -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
......
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