Skip to content

Commit

Permalink
Fix two regressions caused by pull request #518:
Browse files Browse the repository at this point in the history
1) NPE in OptionCompleter
2) script command info returns empty string
  • Loading branch information
mattirn committed Mar 23, 2020
1 parent d3336a0 commit c191801
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions builtins/src/main/java/org/jline/builtins/Builtins.java
Expand Up @@ -410,6 +410,8 @@ public String[] lines() {
} else {
out = helpMessage.substring(0,tm.start(1));
}
} else if (!body) {
out = helpMessage;
}
return out.split("\\r?\\n");
}
Expand Down
2 changes: 1 addition & 1 deletion builtins/src/main/java/org/jline/builtins/Completers.java
Expand Up @@ -945,7 +945,7 @@ public void complete(LineReader reader, final ParsedLine commandLine, List<Candi
candidates.add(new Candidate(buffer, buffer, null, null, null, null, true));
return;
}
String command = reader.getParser().getCommand(words.get(words.size() - startPos));
String command = reader.getParser().getCommand(words.get(startPos - 1));
if (buffer.startsWith("-")) {
boolean addbuff = true;
boolean valueCandidates = false;
Expand Down

0 comments on commit c191801

Please sign in to comment.