summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoopur Gupta2013-02-13 05:43:55 (EST)
committer Dani Megert2013-02-13 05:43:55 (EST)
commit125bb2069af7e225f1ede8dc599552d6c5413e66 (patch)
tree0fbc1202774cf3a6cd957562c29f6ac310d13de6
parent46efd2451d977da3aa43c14af834d609c722b263 (diff)
downloadeclipse.jdt.ui-125bb2069af7e225f1ede8dc599552d6c5413e66.zip
eclipse.jdt.ui-125bb2069af7e225f1ede8dc599552d6c5413e66.tar.gz
eclipse.jdt.ui-125bb2069af7e225f1ede8dc599552d6c5413e66.tar.bz2
Fixed bug 399997: [hovering] Bracket hover gets messed up when code is
folded
-rw-r--r--org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaSourceHover.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaSourceHover.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaSourceHover.java
index 7d0b51b..9f42157 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaSourceHover.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaSourceHover.java
@@ -62,6 +62,7 @@ import org.eclipse.jdt.ui.SharedASTProvider;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer;
import org.eclipse.jdt.internal.ui.text.JavaCodeReader;
import org.eclipse.jdt.internal.ui.text.JavaPairMatcher;
@@ -218,8 +219,10 @@ public class JavaSourceHover extends AbstractJavaEditorTextHover {
int noOfSourceLines;
IRegion endLine;
int skippedLines= 0;
- if (line1 < topLine) {
- //match not visible
+ int wLine1= ((JavaSourceViewer) textViewer).modelLine2WidgetLine(line1);
+ int wLine2= ((JavaSourceViewer) textViewer).modelLine2WidgetLine(line2);
+ if ((line1 < topLine) || (wLine1 != -1 && (wLine2 - wLine1 != line2 - line1))) {
+ // match not visible or content is folded - see bug 399997
if (isElseBracket) {
return getBracketHoverInfoForElse((IfStatement) node, document, editorInput, delim); // see bug:377141
}