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:
parent
5cada17513
commit
a3e7c1ab78
1 changed files with 5 additions and 2 deletions
|
@ -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 == '_';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue