aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/refactoringchanges.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-08-12 12:39:27 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2020-08-12 12:31:54 +0000
commit0222d5007eceaf5951340430a34cc55efd66e24d (patch)
treeccbf08bb6b80ac1f0b085427d4f4e5d69436a34f /src/plugins/texteditor/refactoringchanges.cpp
parent2d61932387699d1817e187fb17054bd2e9dd62d7 (diff)
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 <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/texteditor/refactoringchanges.cpp')
-rw-r--r--src/plugins/texteditor/refactoringchanges.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/texteditor/refactoringchanges.cpp b/src/plugins/texteditor/refactoringchanges.cpp
index 0ee7410b41..a79d28bfaf 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!