Skip to content

Commit

Permalink
Updated Annotation HoverInfo to only display text at a line rather th…
Browse files Browse the repository at this point in the history
…an all annotation text in the document
  • Loading branch information
kattrali committed Nov 9, 2010
1 parent 65fd673 commit 5455028
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/com/redcareditor/mate/MateText.java
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,15 @@ public Object[] getSupertypes(Object annotationType) {
// annotation hover manager
class AnnotationHover implements IAnnotationHover, ITextHover {
public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) {
Iterator ite = fAnnotationModel.getAnnotationIterator();
StyledText text = getTextWidget();
int startOffset = text.getOffsetAtLine(lineNumber);
int endOffset;
if (lineNumber == text.getLineCount() - 1)
endOffset = text.getCharCount();
else
endOffset = text.getOffsetAtLine(lineNumber + 1);
Iterator ite = fAnnotationModel.getAnnotationIterator(
startOffset, endOffset - startOffset, false, true);

ArrayList all = new ArrayList();

Expand Down

0 comments on commit 5455028

Please sign in to comment.