TextEditors: Do not add to history twice for Ctrl+Click navigation

When Ctrl+Clicking to follow symbols, the original location was added
twice to the history, once in the click handler, and once when the link
was opened in `TextEditorWidget::openLink`

Change-Id: I806165621d7ea229aa963b5b7d83c5327d8e7f14
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2024-05-13 16:25:38 +02:00
parent 9160679b04
commit 9f1c6e9c72

View File

@@ -6861,7 +6861,6 @@ void TextEditorWidget::mouseReleaseEvent(QMouseEvent *e)
{
const Qt::MouseButton button = e->button();
if (d->m_linkPressed && d->isMouseNavigationEvent(e) && button == Qt::LeftButton) {
EditorManager::addCurrentPositionToNavigationHistory();
bool inNextSplit = ((e->modifiers() & Qt::AltModifier) && !alwaysOpenLinksInNextSplit())
|| (alwaysOpenLinksInNextSplit() && !(e->modifiers() & Qt::AltModifier));