Index: languages/engine/src/org/netbeans/modules/languages/features/LanguagesNavigator.java =================================================================== RCS file: /cvs/languages/engine/src/org/netbeans/modules/languages/features/LanguagesNavigator.java,v retrieving revision 1.16 diff -u -u -r1.16 LanguagesNavigator.java --- languages/engine/src/org/netbeans/modules/languages/features/LanguagesNavigator.java 6 Sep 2007 15:03:04 -0000 1.16 +++ languages/engine/src/org/netbeans/modules/languages/features/LanguagesNavigator.java 23 Sep 2007 22:16:18 -0000 @@ -270,10 +270,7 @@ return null; } if (navigator == null) return null; - Line line = lineSet != null ? - lineSet.getCurrent (NbDocument.findLineNumber (doc, item.getOffset ())) - : null; - int column = NbDocument.findLineColumn (doc, item.getOffset ()); + int offset = item.getOffset(); Context context = SyntaxContext.create (doc, astPath); String displayName = (String) navigator.getValue ("display_name", context); if (displayName == null || displayName.trim().length() == 0) { @@ -287,7 +284,7 @@ return new NavigatorNode ( item, new ArrayList (path), - line, column, + doc, lineSet, displayName, tooltip, icon, isLeaf ); @@ -404,7 +401,7 @@ NavigatorNode navigatorNode = new NavigatorNode ( root, path, - null, 0, + null, null, "root", null, "org/netbeans/modules/languages/resources/node.gif", false @@ -539,8 +536,8 @@ static class NavigatorNode { - Line line; - int column; + Line.Set lineSet; + NbEditorDocument doc; String displayName; String tooltip; String icon; @@ -552,8 +549,8 @@ NavigatorNode ( ASTItem item, List path, - Line line, - int column, + NbEditorDocument doc, + Line.Set lineSet, String displayName, String tooltip, String icon, @@ -561,8 +558,8 @@ ) { this.item = item; this.path = path; - this.line = line; - this.column = column; + this.doc = doc; + this.lineSet = lineSet; this.displayName = displayName; this.tooltip = tooltip; this.icon = icon; @@ -587,7 +584,11 @@ if (selObj == null || !(selObj instanceof NavigatorNode)) return; NavigatorNode node = (NavigatorNode)selObj; - node.line.show (Line.SHOW_GOTO, node.column); + int offset = node.path.get(node.path.size()-1).getOffset(); + Line line = node.lineSet != null ? + node.lineSet.getCurrent (NbDocument.findLineNumber (node.doc, offset)) : null; + int column = NbDocument.findLineColumn(node.doc, offset); + line.show (Line.SHOW_GOTO, column); } public void mouseEntered (MouseEvent e) {