Commit 87ed61bd authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Register Ctrl + Click jumps


Signed-off-by: Waqar Ahmed's avatarWaqar Ahmed <waqar.17a@gmail.com>
parent 960737da
......@@ -64,6 +64,13 @@ public:
return m_configPath.isEmpty() ? m_defaultConfigPath : m_configPath;
}
Q_SIGNALS:
/**
* Signal that we jumped to a location
*/
void jumped(const QUrl &, int line, int col);
private:
Q_SIGNALS:
// signal settings update
......
......@@ -409,6 +409,11 @@ Q_SIGNALS:
*/
void message(const QVariantMap &message);
/**
* Signal that we jumped to a location
*/
void jumped(const QUrl &url, int line, int col);
public:
LSPClientActionView(LSPClientPlugin *plugin, KTextEditor::MainWindow *mainWin, KXMLGUIClient *client, QSharedPointer<LSPClientServerManager> serverManager)
: QObject(mainWin)
......@@ -659,6 +664,7 @@ public:
if (mouseEvent->button() == Qt::LeftButton && mouseEvent->modifiers() == Qt::ControlModifier) {
// must set cursor else we will be jumping somewhere else!!
v->setCursorPosition(cur);
Q_EMIT jumped(v->document()->url(), cur.line(), cur.column());
if (!word.isEmpty()) {
m_ctrlHoverFeedback.clear(m_mainWindow->activeView());
goToDefinition();
......@@ -1025,6 +1031,9 @@ public:
KTextEditor::Document *document = activeView->document();
KTextEditor::Cursor cdef(line, column);
// tell Kate we have jumped to this location for record
Q_EMIT jumped(uri, line, column);
if (document && uri == document->url()) {
activeView->setCursorPosition(cdef);
highlightLandingLocation(activeView, location);
......@@ -2415,6 +2424,8 @@ public:
m_mainWindow->guiFactory()->addClient(this);
connect(m_actionView.get(), &LSPClientActionView::message, this, &LSPClientPluginViewImpl::message);
connect(m_actionView.get(), &LSPClientActionView::jumped, this, &LSPClientPluginViewImpl::jumped);
connect(this, &self_type::jumped, plugin, &LSPClientPlugin::jumped);
}
~LSPClientPluginViewImpl() override
......@@ -2435,6 +2446,11 @@ Q_SIGNALS:
* @param message outgoing message we send to the host application
*/
void message(const QVariantMap &message);
/**
* Signal that we jumped to a location
*/
void jumped(const QUrl &url, int line, int col);
};
QObject *LSPClientPluginView::new_(LSPClientPlugin *plugin, KTextEditor::MainWindow *mainWin)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment