Skip to content

Commit

Permalink
Suppress outputting of group names in list and menu
Browse files Browse the repository at this point in the history
  • Loading branch information
cdupuis committed Feb 20, 2017
1 parent b6b3136 commit 43cde96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions reader/src/main/java/org/jline/reader/LineReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ enum Option {
HISTORY_REDUCE_BLANKS(true),
HISTORY_BEEP(true),
HISTORY_INCREMENTAL(true),
AUTO_GROUP(true),
AUTO_MENU(true),
AUTO_LIST(true),
RECOGNIZE_EXACT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4263,7 +4263,7 @@ protected PostResult computePost(List<Candidate> possible, Candidate selection,
if (group.isEmpty() && sorted.size() > 1) {
group = "others";
}
if (!group.isEmpty()) {
if (!group.isEmpty() && isSet(Option.AUTO_GROUP)) {
strings.add(group);
}
strings.add(new ArrayList<>(entry.getValue().values()));
Expand All @@ -4281,8 +4281,10 @@ protected PostResult computePost(List<Candidate> possible, Candidate selection,
}
sorted.put(cand.value(), cand);
}
for (String group : groups) {
strings.add(group);
if (isSet(Option.AUTO_GROUP)) {
for (String group : groups) {
strings.add(group);
}
}
strings.add(new ArrayList<>(sorted.values()));
if (ordered != null) {
Expand Down

0 comments on commit 43cde96

Please sign in to comment.