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
Kate
Commits
ce14e874
Commit
ce14e874
authored
Jan 11, 2021
by
Waqar Ahmed
Committed by
Christoph Cullmann
Jan 11, 2021
Browse files
Ensure we are working with a valid cursor always
parent
7e0f6fcd
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/lspclient/lspclientpluginview.cpp
View file @
ce14e874
...
...
@@ -593,12 +593,15 @@ public:
const
auto
coords
=
wid
->
mapTo
(
v
,
mouseEvent
->
pos
());
const
auto
cur
=
v
->
coordinatesToCursor
(
coords
);
const
auto
word
=
v
->
document
()
->
wordAt
(
cur
);
// there isn't much we can do now, just bail out
if
(
!
cur
.
isValid
())
return
false
;
// The user pressed Ctrl + Click
if
(
event
->
type
()
==
QEvent
::
MouseButtonPress
)
{
if
(
mouseEvent
->
button
()
==
Qt
::
LeftButton
&&
mouseEvent
->
modifiers
()
==
Qt
::
ControlModifier
)
{
// must set cursor else we will be jumping somewhere else!!
const
auto
word
=
v
->
document
()
->
wordAt
(
cur
);
v
->
setCursorPosition
(
cur
);
if
(
!
word
.
isEmpty
())
{
m_ctrlHoverFeedback
.
clear
(
m_mainWindow
->
activeView
());
...
...
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