Skip to content

Commit

Permalink
widget: list also builtin widgets, fixes #467
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed Nov 12, 2019
1 parent c2a46f1 commit 129c875
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion builtins/src/main/java/org/jline/builtins/Commands.java
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,14 @@ public static void widget(LineReader reader, PrintStream out, PrintStream err,
return;
}
if (opt.isSet("l")) {
for (String s : new TreeSet<>(reader.getWidgets().keySet())) {
TreeSet<String> ws = new TreeSet<>(reader.getWidgets().keySet());
if (opt.isSet("a")) {
Set<String> temp = new HashSet<>(ws);
for (String s: temp) {
ws.add(reader.getWidgets().get(s).toString());
}
}
for (String s : ws) {
if (opt.isSet("a")) {
out.println(s);
} else if (!reader.getWidgets().get(s).toString().startsWith(".")) {
Expand Down

0 comments on commit 129c875

Please sign in to comment.