Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

defensive

  • Loading branch information...
commit 34c0423846fb3b9ad5587c3c30c7d0a02ce208d9 1 parent b73f0ea
@JPMoresmau authored
View
6 ...ll.ui/src/net/sf/eclipsefp/haskell/ui/internal/editors/haskell/text/HaskellFoldingStructureProvider.java
@@ -69,11 +69,13 @@ private Position createPosition( final int startLine, final int endLine ) {
Position result = null;
try {
int start = document.getLineOffset( startLine -1 );
- int end = document.getLineOffset( endLine -1)
- + document.getLineLength( endLine -1);
+ int endLine2=Math.min( document.getNumberOfLines()-1, endLine -1 );
+ int end = document.getLineOffset( endLine2)
+ + document.getLineLength( endLine2);
result = new Position( start, end - start );
} catch( final BadLocationException badlox ) {
// ignored
+ System.err.println(startLine+","+endLine);
badlox.printStackTrace();
}
return result;
Please sign in to comment.
Something went wrong with that request. Please try again.