1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-14 03:35:37 +02:00

Fix problems opening external files

This commit is contained in:
Anton Leherbauer 2007-01-25 16:35:08 +00:00
parent 3491d11518
commit 66d496359f
2 changed files with 4 additions and 8 deletions

View file

@ -307,14 +307,10 @@ public class EditorUtility {
}
// no translation unit - still try to get a sensible marker resource
// from the associated element
if (context instanceof IWorkingCopy && ((IWorkingCopy) context).isWorkingCopy()) {
context= ((IWorkingCopy) context).getOriginalElement();
if (cproject != null) {
IResource markerResource= cproject.getProject();
return new ExternalEditorInput(new FileStorage(location), markerResource);
}
IResource markerResource= null;
if (context != null) {
markerResource= context.getUnderlyingResource();
}
return new ExternalEditorInput(new FileStorage(location), markerResource);
}
return new ExternalEditorInput(new FileStorage(location));
}

View file

@ -135,7 +135,7 @@ public class ExternalEditorInput implements ITranslationUnitEditorInput {
* and a reference to a resource which holds the markers for the external file.
*/
public ExternalEditorInput(IStorage exFile, IResource markerResource) {
this.externalFile = exFile ;
this(exFile, exFile.getFullPath());
this.markerResource = markerResource ;
}