Skip to content

Commit

Permalink
Use the post message to prompt the user for confirmation when display…
Browse files Browse the repository at this point in the history
…ing lots of completion candidates to avoid display problems
  • Loading branch information
gnodet committed Apr 27, 2017
1 parent 16055f7 commit b19712a
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -4267,17 +4267,12 @@ protected boolean doList(List<Candidate> possible, String completed, boolean run
if (listMax > 0 && possible.size() >= listMax
|| lines >= size.getRows() - promptLines) {
// prompt
post = null;
int oldCursor = buf.cursor();
buf.cursor(buf.length());
redisplay(true);
buf.cursor(oldCursor);
println();
print(getAppName() + ": do you wish to see to see all " + possible.size()
post = () -> new AttributedString(getAppName() + ": do you wish to see to see all " + possible.size()
+ " possibilities (" + lines + " lines)?");
flush();
redisplay(true);
int c = readCharacter();
if (c != 'y' && c != 'Y' && c != '\t') {
post = null;
return false;
}
}
Expand Down

1 comment on commit b19712a

@jdillon
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx!

Please sign in to comment.