mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-01 13:25:45 +02:00
Bug 442123: java.lang.StringIndexOutOfBoundsException in
org.eclipse.cdt.make.internal.ui.text.WordPartDetector
This commit is contained in:
parent
58af86640b
commit
63c28d216f
1 changed files with 5 additions and 1 deletions
|
@ -119,7 +119,11 @@ public class WordPartDetector {
|
||||||
// the cursor is on the first word which is "include" keyword
|
// the cursor is on the first word which is "include" keyword
|
||||||
// so find the second word which is the first include file
|
// so find the second word which is the first include file
|
||||||
String sub = line.substring(line.indexOf(' ', position)).trim();
|
String sub = line.substring(line.indexOf(' ', position)).trim();
|
||||||
wordPart = sub.substring(0, sub.indexOf(' ')).trim();
|
if (sub.contains(" ")) { //$NON-NLS-1$
|
||||||
|
wordPart = sub.substring(0, sub.indexOf(' ')).trim();
|
||||||
|
} else {
|
||||||
|
wordPart = sub;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
wordPart = findWord(line, position);
|
wordPart = findWord(line, position);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue