forked from qt-creator/qt-creator
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:
@@ -6861,7 +6861,6 @@ void TextEditorWidget::mouseReleaseEvent(QMouseEvent *e)
|
|||||||
{
|
{
|
||||||
const Qt::MouseButton button = e->button();
|
const Qt::MouseButton button = e->button();
|
||||||
if (d->m_linkPressed && d->isMouseNavigationEvent(e) && button == Qt::LeftButton) {
|
if (d->m_linkPressed && d->isMouseNavigationEvent(e) && button == Qt::LeftButton) {
|
||||||
EditorManager::addCurrentPositionToNavigationHistory();
|
|
||||||
bool inNextSplit = ((e->modifiers() & Qt::AltModifier) && !alwaysOpenLinksInNextSplit())
|
bool inNextSplit = ((e->modifiers() & Qt::AltModifier) && !alwaysOpenLinksInNextSplit())
|
||||||
|| (alwaysOpenLinksInNextSplit() && !(e->modifiers() & Qt::AltModifier));
|
|| (alwaysOpenLinksInNextSplit() && !(e->modifiers() & Qt::AltModifier));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user