Commit 08b9e8c4 authored by Jekyll Wu's avatar Jekyll Wu
Browse files

Rename: 'guard' is too generic and not clear enough within its context

parent 1ab2fc1b
......@@ -96,13 +96,13 @@ void PlainTextDecoder::decodeLine(const Character* const characters, int count,
}
// find out the last technically real character in the line
int guard = -1;
int realCharacterGuard = -1;
for (int i = count - 1 ; i >= 0 ; i--) {
// FIXME: the special case of '\n' here is really ugly
// Maybe the '\n' should be added after calling this method in
// Screen::copyLineToStream()
if (characters[i].isRealCharacter && characters[i].character != '\n') {
guard = i;
realCharacterGuard = i;
break;
}
}
......@@ -124,7 +124,7 @@ void PlainTextDecoder::decodeLine(const Character* const characters, int count,
// This feels tricky, but otherwise leading "whitespaces" may be
// lost in some situation. One typical example is copying the result
// of `dialog --infobox "qwe" 10 10` .
if (characters[i].isRealCharacter || i <= guard) {
if (characters[i].isRealCharacter || i <= realCharacterGuard) {
plainText.append(QChar(characters[i].character));
i += qMax(1, konsole_wcwidth(characters[i].character));
} else {
......
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