1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

use setSelection(ICElement) in revealInEditor.

This commit is contained in:
Alain Magloire 2003-04-17 16:56:05 +00:00
parent 49b2c967a1
commit 7f50dfa6f3

View file

@ -102,13 +102,7 @@ public class EditorUtility {
*/
public static void revealInEditor(IEditorPart part, ICElement element) {
if (element != null && part instanceof CEditor) {
if (element instanceof ISourceReference) {
try {
ISourceRange range = ((ISourceReference) element).getSourceRange();
((CEditor) part).setSelection(range, true);
} catch (CModelException e) {
}
}
((CEditor) part).setSelection(element);
}
}