diff --git a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java index cc2bd04218c3..449b1bacf8e9 100644 --- a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java +++ b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java @@ -1465,7 +1465,11 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig if (file.getFileType().isBinary()) { return null; } - return instance.openTextEditor(new OpenFileDescriptor(project, file), false); + Editor editor = instance.openTextEditor(new OpenFileDescriptor(project, file), false); + if (editor != null) { + editor.getCaretModel().moveToOffset(0); + } + return editor; } private long collectAndCheckHighlighting(boolean checkWarnings, boolean checkInfos, boolean checkWeakWarnings) throws Exception {