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
651ebc2c
Commit
651ebc2c
authored
Dec 24, 2021
by
Martin Tobias Holmedahl Sandsmark
Browse files
Work around weird position reported from filters.
CCBUG: 447478
parent
02e21a81
Pipeline
#115069
passed with stage
in 1 minute and 55 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/terminalDisplay/TerminalDisplay.cpp
View file @
651ebc2c
...
...
@@ -1859,9 +1859,23 @@ out:
QPoint
TerminalDisplay
::
findWordEnd
(
const
QPoint
&
pnt
)
{
const
int
maxY
=
_screenWindow
->
lineCount
()
-
1
;
const
int
maxX
=
_columns
-
1
;
QSharedPointer
<
HotSpot
>
hotspot
=
_filterChain
->
hotSpotAt
(
pnt
.
y
(),
pnt
.
x
());
if
(
hotspot
)
{
return
QPoint
(
hotspot
->
endColumn
()
-
1
,
hotspot
->
endLine
());
int
line
=
hotspot
->
endLine
();
int
col
=
hotspot
->
endColumn
();
// Because of how filters work with end of line, we need this hack.
// It really should be fixed in filters, but this is the best we have until then
if
(
col
>
0
)
{
col
--
;
}
else
{
col
=
maxX
;
line
--
;
}
return
{
qBound
(
0
,
col
,
maxX
),
qBound
(
0
,
line
,
maxY
)
};
}
const
int
regSize
=
qMax
(
_screenWindow
->
windowLines
(),
10
);
...
...
@@ -1876,8 +1890,6 @@ QPoint TerminalDisplay::findWordEnd(const QPoint &pnt)
Character
*
tmp_image
=
nullptr
;
const
QChar
selClass
=
charClass
(
image
[
j
]);
const
int
imageSize
=
regSize
*
_columns
;
const
int
maxY
=
_screenWindow
->
lineCount
()
-
1
;
const
int
maxX
=
_columns
-
1
;
while
(
true
)
{
const
int
lineCount
=
lineProperties
.
count
();
...
...
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