Skip to content
Snippets Groups Projects
Commit dd17451e authored by Christoph Döbber's avatar Christoph Döbber
Browse files

fixed bug in field assist

refs 86
parent ddb5c737
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,7 @@ import org.eclipse.swt.widgets.Text;
* @author doebber
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: 7CF69F2D99AF737A905EC1FA352EF278
* @ConQAT.Rating YELLOW Hash: 10BFEAD4A602E137D545980D6A831649
*/
public class FieldAssist {
......@@ -117,8 +117,7 @@ public class FieldAssist {
@Override
public IContentProposal[] getProposals(String contents, int position) {
int tmp = findBeginningOfWord(contents, position);
String currentWord = contents.substring(
Math.min(position, tmp + 1), position);
String currentWord = contents.substring(tmp + 1, position);
setProposals(concreteProvider.getProposals(currentWord));
return super.getProposals(currentWord, position);
}
......@@ -127,7 +126,7 @@ public class FieldAssist {
/** Finds the beginning of the word the cursor is placed in. */
private int findBeginningOfWord(String contents, int position) {
int tmp = Math.max(0, position - 1);
while (tmp > 0 && !Character.isWhitespace(contents.charAt(tmp))
while (tmp >= 0 && !Character.isWhitespace(contents.charAt(tmp))
&& !isAdditionalWhitespace(contents.charAt(tmp))) {
tmp--;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment