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:
parent
3491d11518
commit
66d496359f
2 changed files with 4 additions and 8 deletions
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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 ;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue