Skip to content
GitLab
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
25e2a9f6
Commit
25e2a9f6
authored
Sep 07, 2022
by
Tomaz Canabrava
Browse files
Remove level of indentation
We can always return on the if, and remove the else.
parent
b3591918
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Screen.cpp
View file @
25e2a9f6
...
...
@@ -1637,40 +1637,40 @@ void Screen::setSelectionEnd(const int x, const int y, const bool trimTrailingWh
_selTopLeft
=
loc
(
qMin
(
topColumn
,
bottomColumn
),
topRow
);
_selBottomRight
=
loc
(
qMax
(
topColumn
,
bottomColumn
),
bottomRow
);
}
else
{
// Extend the selection to the rightmost column if beyond the last character in the line
const
int
bottomRow
=
_selBottomRight
/
_columns
;
const
int
bottomColumn
=
_selBottomRight
%
_columns
;
return
;
}
// Extend the selection to the rightmost column if beyond the last character in the line
const
int
bottomRow
=
_selBottomRight
/
_columns
;
const
int
bottomColumn
=
_selBottomRight
%
_columns
;
bool
beyondLastColumn
=
true
;
if
(
bottomRow
<
_history
->
getLines
())
{
ImageLine
histLine
;
const
int
histLineLen
=
_history
->
getLineLen
(
bottomRow
);
histLine
.
resize
(
histLineLen
);
bool
beyondLastColumn
=
true
;
if
(
bottomRow
<
_history
->
getLines
())
{
ImageLine
histLine
;
const
int
histLineLen
=
_history
->
getLineLen
(
bottomRow
);
histLine
.
resize
(
histLineLen
);
_history
->
getCells
(
bottomRow
,
0
,
histLineLen
,
histLine
.
data
());
_history
->
getCells
(
bottomRow
,
0
,
histLineLen
,
histLine
.
data
());
for
(
int
j
=
bottomColumn
;
j
<
histLineLen
;
j
++
)
{
if
((
histLine
.
at
(
j
).
flags
&
EF_REAL
)
!=
0
&&
(
!
trimTrailingWhitespace
||
!
QChar
(
histLine
.
at
(
j
).
character
).
isSpace
()))
{
beyondLastColumn
=
false
;
}
for
(
int
j
=
bottomColumn
;
j
<
histLineLen
;
j
++
)
{
if
((
histLine
.
at
(
j
).
flags
&
EF_REAL
)
!=
0
&&
(
!
trimTrailingWhitespace
||
!
QChar
(
histLine
.
at
(
j
).
character
).
isSpace
()))
{
beyondLastColumn
=
false
;
}
}
else
{
const
size_t
line
=
bottomRow
-
_history
->
getLines
();
const
int
lastColumn
=
(
line
<
_lineProperties
.
size
()
&&
_lineProperties
[
line
]
&
LINE_DOUBLEWIDTH
)
?
_columns
/
2
:
_columns
;
const
auto
*
data
=
_screenLines
[
line
].
data
()
;
const
int
length
=
_screenLines
.
at
(
line
).
count
();
for
(
int
k
=
bottomColumn
;
k
<
lastColumn
&&
k
<
length
;
k
++
)
{
if
((
data
[
k
].
flags
&
EF_REAL
)
!=
0
&&
(
!
trimTrailingWhitespace
||
!
QChar
(
data
[
k
].
character
).
isSpace
())
)
{
beyondLastColumn
=
false
;
}
}
}
else
{
const
size_t
line
=
bottomRow
-
_history
->
getLines
()
;
const
int
lastColumn
=
(
line
<
_lineProperties
.
size
()
&&
_lineProperties
[
line
]
&
LINE_DOUBLEWIDTH
)
?
_columns
/
2
:
_columns
;
const
auto
*
data
=
_screenLines
[
line
].
data
();
const
int
length
=
_screenLines
.
at
(
line
).
count
();
for
(
int
k
=
bottomColumn
;
k
<
lastColumn
&&
k
<
length
;
k
++
)
{
if
((
data
[
k
].
flags
&
EF_REAL
)
!=
0
&&
(
!
trimTrailingWhitespace
||
!
QChar
(
data
[
k
].
character
).
isSpace
()))
{
beyondLastColumn
=
false
;
}
}
}
if
(
beyondLastColumn
)
{
_selBottomRight
=
loc
(
_columns
-
1
,
bottomRow
);
}
if
(
beyondLastColumn
)
{
_selBottomRight
=
loc
(
_columns
-
1
,
bottomRow
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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