mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for Bug 158193 - [navigation] incorrect editor opened for external files
This commit is contained in:
parent
e36cb0d76f
commit
ba0d37b4a8
1 changed files with 4 additions and 5 deletions
|
@ -210,15 +210,14 @@ public class EditorUtility {
|
||||||
|
|
||||||
private static IEditorInput getEditorInput(ICElement element) throws CModelException {
|
private static IEditorInput getEditorInput(ICElement element) throws CModelException {
|
||||||
while (element != null) {
|
while (element != null) {
|
||||||
if (element instanceof IWorkingCopy && ((IWorkingCopy) element).isWorkingCopy())
|
|
||||||
element= ((IWorkingCopy) element).getOriginalElement();
|
|
||||||
|
|
||||||
if (element instanceof ISourceReference) {
|
if (element instanceof ISourceReference) {
|
||||||
ITranslationUnit tu = ((ISourceReference)element).getTranslationUnit();
|
ITranslationUnit tu = ((ISourceReference)element).getTranslationUnit();
|
||||||
if (tu != null) {
|
if (tu != null) {
|
||||||
element = tu;
|
element = tu;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (element instanceof IWorkingCopy && ((IWorkingCopy) element).isWorkingCopy())
|
||||||
|
element= ((IWorkingCopy) element).getOriginalElement();
|
||||||
|
|
||||||
if (element instanceof ITranslationUnit) {
|
if (element instanceof ITranslationUnit) {
|
||||||
ITranslationUnit unit= (ITranslationUnit) element;
|
ITranslationUnit unit= (ITranslationUnit) element;
|
||||||
|
@ -226,7 +225,7 @@ public class EditorUtility {
|
||||||
if (resource instanceof IFile) {
|
if (resource instanceof IFile) {
|
||||||
return new FileEditorInput((IFile) resource);
|
return new FileEditorInput((IFile) resource);
|
||||||
}
|
}
|
||||||
return new ExternalEditorInput(unit, getStorage(unit));
|
return new ExternalEditorInput(unit, new FileStorage(unit.getPath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (element instanceof IBinary) {
|
if (element instanceof IBinary) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue