diff --git a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileEditorManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileEditorManagerImpl.java index 357b864d2ec9..f453068d29ab 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileEditorManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileEditorManagerImpl.java @@ -552,7 +552,14 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Projec throw new IllegalArgumentException("file is not valid: " + file); } assertDispatchThread(); - return openFileImpl2(getSplitters().getOrCreateCurrentWindow(file), file, focusEditor); + EditorsSplitters splitters = getSplitters(); + + EditorWindow wndToOpenIn = splitters.getCurrentWindow(); + if (wndToOpenIn == null) { + wndToOpenIn = splitters.getOrCreateCurrentWindow(file); + } + + return openFileImpl2(wndToOpenIn, file, focusEditor); } @NotNull public Pair openFileImpl2(@NotNull final EditorWindow window,