From 0222d5007eceaf5951340430a34cc55efd66e24d Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 12 Aug 2020 12:39:27 +0200 Subject: [PATCH] TextEditor: After refactoring, do not open the same document again ... if it is already visible in a different split view. Activate that one instead. Fixes: QTCREATORBUG-13145 Change-Id: I5facfb23e8e8163d8653c7926d5bf6848f42bd9a Reviewed-by: David Schulz --- src/plugins/texteditor/refactoringchanges.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/refactoringchanges.cpp b/src/plugins/texteditor/refactoringchanges.cpp index 0ee7410b41a..a79d28bfafd 100644 --- a/src/plugins/texteditor/refactoringchanges.cpp +++ b/src/plugins/texteditor/refactoringchanges.cpp @@ -124,7 +124,9 @@ bool RefactoringChanges::removeFile(const QString &fileName) const TextEditorWidget *RefactoringChanges::openEditor(const QString &fileName, bool activate, int line, int column) { EditorManager::OpenEditorFlags flags = EditorManager::IgnoreNavigationHistory; - if (!activate) + if (activate) + flags |= EditorManager::SwitchSplitIfAlreadyVisible; + else flags |= EditorManager::DoNotChangeCurrentEditor; if (line != -1) { // openEditorAt uses a 1-based line and a 0-based column!