Commit fcf5c0ea authored by hjk's avatar hjk
Browse files

TextEditor: Move cursor position label connection



... to a place where there's no need to call editor()

Change-Id: I0fcebcf8b36602bf48373a6b57d8a709cc2a7e81
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 5941345f
......@@ -524,14 +524,6 @@ BaseTextEditorWidgetPrivate::BaseTextEditorWidgetPrivate(BaseTextEditorWidget *p
m_cursorPositionLabelAction = m_toolBar->addWidget(m_cursorPositionLabel);
m_fileEncodingLabelAction = m_toolBar->addWidget(m_fileEncodingLabel);
connect(m_cursorPositionLabel, &LineColumnLabel::clicked, [this] {
EditorManager::activateEditor(q->editor(), EditorManager::IgnoreNavigationHistory);
if (Core::Command *cmd = ActionManager::command(Core::Constants::GOTO)) {
if (QAction *act = cmd->action())
act->trigger();
}
});
}
} // namespace Internal
......@@ -7329,6 +7321,13 @@ BaseTextEditor *BaseTextEditorFactory::createEditorHelper(const BaseTextDocument
widget->finalizeInitialization();
editor->finalizeInitialization();
connect(widget->d->m_cursorPositionLabel, &LineColumnLabel::clicked, [editor] {
EditorManager::activateEditor(editor, EditorManager::IgnoreNavigationHistory);
if (Core::Command *cmd = ActionManager::command(Core::Constants::GOTO)) {
if (QAction *act = cmd->action())
act->trigger();
}
});
return editor;
}
......
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