mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
navigation to class fixed if file not opened (IDEADEV-41617 re-fixed)
This commit is contained in:
@@ -34,6 +34,7 @@ public class GotoClassTest extends FileEditorManagerTestCase {
|
||||
|
||||
getEditor(virtualFile).getCaretModel().moveToOffset(identifierOffset + 3); // it's still inside the class, so keep it
|
||||
|
||||
myManager.closeAllFiles();
|
||||
NavigationUtil.activateFileWithPsiElement(psiClass);
|
||||
assertEquals(identifierOffset + 3, getOffset(virtualFile));
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ public final class NavigationUtil {
|
||||
|
||||
final FileEditorManager fem = FileEditorManager.getInstance(elt.getProject());
|
||||
if (!fem.isFileOpen(vFile)) {
|
||||
return false;
|
||||
fem.openFile(vFile, true, searchForOpen);
|
||||
}
|
||||
|
||||
final TextRange range = elt.getTextRange();
|
||||
@@ -171,9 +171,7 @@ public final class NavigationUtil {
|
||||
if (editor instanceof TextEditor) {
|
||||
final Editor text = ((TextEditor)editor).getEditor();
|
||||
final int offset = text.getCaretModel().getOffset();
|
||||
|
||||
if (range.contains(offset)) {
|
||||
fem.openFile(vFile, true, searchForOpen);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user