Patch Set 4:

The fix works but I would simplify it: there's no need for an early return (and code duplication) if we just assign the style range if it is valid:

StyleRange r= null;
if (o < t.getCharCount())
    r= t.getStyleRangeAtOffset(o);

The code that follows handles the 'null' case as expected.


Kevin, I tried to upload a new patch here but couldn't figure out how to do this from EGit i.e. push so that it gets appended here.