Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
08b9e8c4
Commit
08b9e8c4
authored
Jun 12, 2012
by
Jekyll Wu
Browse files
Rename: 'guard' is too generic and not clear enough within its context
parent
1ab2fc1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/TerminalCharacterDecoder.cpp
View file @
08b9e8c4
...
...
@@ -96,13 +96,13 @@ void PlainTextDecoder::decodeLine(const Character* const characters, int count,
}
// find out the last technically real character in the line
int
g
uard
=
-
1
;
int
realCharacterG
uard
=
-
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'
)
{
g
uard
=
i
;
realCharacterG
uard
=
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
<=
g
uard
)
{
if
(
characters
[
i
].
isRealCharacter
||
i
<=
realCharacterG
uard
)
{
plainText
.
append
(
QChar
(
characters
[
i
].
character
));
i
+=
qMax
(
1
,
konsole_wcwidth
(
characters
[
i
].
character
));
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment