Skip to content

Commit

Permalink
Minor completion bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Aug 28, 2013
1 parent 9ee4745 commit 115deab
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ public void complete(final CompleteOperation completeOperation, final InputCompo
choices.add(convert);
}
}
// Copied from FileLister
// TODO Review
if (choices.size() > 1)
{
String startsWith = Parser.findStartsWith(choices);
Expand All @@ -58,12 +56,20 @@ public void complete(final CompleteOperation completeOperation, final InputCompo
String substring = startsWith.substring(typedValue.length());
String candidate = Parser.switchSpacesToEscapedSpacesInWord(substring);
completeOperation.addCompletionCandidate(candidate);
completeOperation.setOffset(completeOperation.getCursor() - typedValue.length());
completeOperation.setOffset(completeOperation.getCursor());
completeOperation.doAppendSeparator(false);
}
else
{
completeOperation.addCompletionCandidates(choices);
if (choices.contains(typedValue))
{
completeOperation.addCompletionCandidate(typedValue);
}
else
{
completeOperation.addCompletionCandidates(choices);

}
if (!completeOperation.getCompletionCandidates().isEmpty() && !typedValue.isEmpty())
{
completeOperation.setOffset(completeOperation.getCursor() - typedValue.length());
Expand Down

0 comments on commit 115deab

Please sign in to comment.