mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-04 06:03:18 +02:00
use setSelection(ICElement) in revealInEditor.
This commit is contained in:
parent
49b2c967a1
commit
7f50dfa6f3
1 changed files with 1 additions and 7 deletions
|
@ -102,13 +102,7 @@ public class EditorUtility {
|
||||||
*/
|
*/
|
||||||
public static void revealInEditor(IEditorPart part, ICElement element) {
|
public static void revealInEditor(IEditorPart part, ICElement element) {
|
||||||
if (element != null && part instanceof CEditor) {
|
if (element != null && part instanceof CEditor) {
|
||||||
if (element instanceof ISourceReference) {
|
((CEditor) part).setSelection(element);
|
||||||
try {
|
|
||||||
ISourceRange range = ((ISourceReference) element).getSourceRange();
|
|
||||||
((CEditor) part).setSelection(range, true);
|
|
||||||
} catch (CModelException e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue