Skip to content

Commit

Permalink
Option group-persist: after double tab keep candidates grouped, fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed Dec 8, 2020
1 parent 329768c commit 538b7fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions reader/src/main/java/org/jline/reader/LineReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ enum Option {
RECOGNIZE_EXACT,
/** display group name before each group (else display all group names first) */
GROUP(true),
/** when double tab to select candidate keep candidates grouped (else loose grouping) */
GROUP_PERSIST(false),
/** if completion is case insensitive or not */
CASE_INSENSITIVE,
LIST_AMBIGUOUS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4927,8 +4927,10 @@ protected boolean doMenu(List<Candidate> original, String completed, BiFunction<
// candidate grouping is not supported by MenuSupport
boolean defaultAutoGroup = isSet(Option.AUTO_GROUP);
boolean defaultGroup = isSet(Option.GROUP);
option(Option.AUTO_GROUP, false);
option(Option.GROUP, false);
if (!isSet(Option.GROUP_PERSIST)) {
option(Option.AUTO_GROUP, false);
option(Option.GROUP, false);
}
// Build menu support
MenuSupport menuSupport = new MenuSupport(original, completed, escaper);
post = menuSupport;
Expand Down

0 comments on commit 538b7fa

Please sign in to comment.