Skip to content

Commit

Permalink
Completion finalizing blank suffix should be optional, fixes #90
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Jul 20, 2015
1 parent 1eb3b62 commit a27f3bd
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@
public class CandidateListCompletionHandler
implements CompletionHandler
{
private boolean printSpaceAfterFullCompletion = true;

public boolean getPrintSpaceAfterFullCompletion() {
return printSpaceAfterFullCompletion;
}

public void setPrintSpaceAfterFullCompletion(boolean printSpaceAfterFullCompletion) {
this.printSpaceAfterFullCompletion = printSpaceAfterFullCompletion;
}

// TODO: handle quotes and escaped quotes && enable automatic escaping of whitespace

public boolean complete(final ConsoleReader reader, final List<CharSequence> candidates, final int pos) throws
Expand All @@ -44,7 +54,7 @@ public boolean complete(final ConsoleReader reader, final List<CharSequence> can
if (candidates.size() == 1) {
CharSequence value = candidates.get(0);

if (buf.cursor == buf.buffer.length()) {
if (buf.cursor == buf.buffer.length() && printSpaceAfterFullCompletion) {
value = value + " ";
}

Expand Down

0 comments on commit a27f3bd

Please sign in to comment.