1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Fix NPE when doubleclicking at end of file

This commit is contained in:
Anton Leherbauer 2007-04-18 13:45:04 +00:00
parent 38b2d76e76
commit 605c54b5d8

View file

@ -45,9 +45,11 @@ public class CDoubleClickSelector implements ITextDoubleClickStrategy {
textViewer.setSelectedRange(region.getOffset() + 1, region.getLength() - 2);
} else {
region= selectWord(document, offset);
if (region != null && region.getLength() > 0) {
textViewer.setSelectedRange(region.getOffset(), region.getLength());
}
}
}
protected IRegion selectWord(IDocument document, int offset) {
return CWordFinder.findWord(document, offset);