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
8224b6fd
Commit
8224b6fd
authored
Apr 29, 2021
by
Mark Nauwelaerts
Browse files
lspclient: refactor goto location
parent
fd6201e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/lspclient/lspclientpluginview.cpp
View file @
8224b6fd
...
...
@@ -1039,22 +1039,19 @@ public:
KTextEditor
::
Document
*
document
=
activeView
->
document
();
KTextEditor
::
Cursor
cdef
(
line
,
column
);
KTextEditor
::
View
*
targetView
=
nullptr
;
if
(
document
&&
uri
==
document
->
url
())
{
targetView
=
activeView
;
}
else
{
targetView
=
m_mainWindow
->
openUrl
(
uri
);
}
if
(
targetView
)
{
// save current position for location history
Q_EMIT
addPositionToHistory
(
activeView
->
document
()
->
url
(),
activeView
->
cursorPosition
());
// save the position to which we are jumping in location history
Q_EMIT
addPositionToHistory
(
activeView
->
document
()
->
url
(),
cdef
);
activeView
->
setCursorPosition
(
cdef
);
highlightLandingLocation
(
activeView
,
location
);
}
else
{
KTextEditor
::
View
*
view
=
m_mainWindow
->
openUrl
(
uri
);
if
(
view
)
{
Q_EMIT
addPositionToHistory
(
activeView
->
document
()
->
url
(),
activeView
->
cursorPosition
());
Q_EMIT
addPositionToHistory
(
view
->
document
()
->
url
(),
cdef
);
view
->
setCursorPosition
(
cdef
);
highlightLandingLocation
(
view
,
location
);
}
Q_EMIT
addPositionToHistory
(
targetView
->
document
()
->
url
(),
cdef
);
targetView
->
setCursorPosition
(
cdef
);
highlightLandingLocation
(
targetView
,
location
);
}
}
...
...
Write
Preview
Markdown
is supported
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