Prettify printing of a small number of completions #49284
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously show_completions() tended to maximize the number of columns used, and if there were few enough completions to only use one or two lines the text would be a little difficult to read. Now it tries to minimize the number of columns, and there's a minimum number of completions (
multicolumn_threshold
) needed before it'll start using multiple columns.Currently
multicolumn_threshold
is 5, which looked good to me.Before:
After:
How to test with Infiltrator.jl:
Main.@exfiltrate
at the beginning ofshow_completions()
.show_completions()
withjulia> first(\t
and remove the call toMain.@exfiltrate
.