1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 20:05:35 +02:00

_ is also part of a word

This commit is contained in:
Alain Magloire 2003-09-08 20:11:37 +00:00
parent 5cada17513
commit a3e7c1ab78

View file

@ -32,10 +32,10 @@ public class WordPartDetector {
IDocument doc = viewer.getDocument();
int bottom = viewer.getBottomIndexEndOffset();
int top = viewer.getTopIndexStartOffset();
while (offset >= top && Character.isLetterOrDigit(doc.getChar(offset))) {
while (offset >= top && isMakefileLetter(doc.getChar(offset))) {
offset--;
}
while (endOffset < bottom && Character.isLetterOrDigit(doc.getChar(endOffset))) {
while (endOffset < bottom && isMakefileLetter(doc.getChar(endOffset))) {
endOffset++;
}
//we've been one step too far : increase the offset
@ -58,4 +58,7 @@ public class WordPartDetector {
return offset;
}
boolean isMakefileLetter(char c) {
return Character.isLetterOrDigit(c) || c == '_';
}
}