-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shorten leaf printing #53
base: master
Are you sure you want to change the base?
Conversation
src/interface.jl
Outdated
show(ioc, ℓ.rule) | ||
printstyled(", "; color = :green) | ||
str = sprint(show, ℓ.state; context = ioc) | ||
print(io, length(str) < 70 ? str : first(str, 50) * " … ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there functionality in Base or InteractiveUtils that can help cut down on magic numbers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can get terminal size, but don't remember how reliably. However, I'm not sure that's what you want here. The goal is to show the optimiser itself, plus a few numbers of its state (to see if all zero), and that doesn't depend on window size.
If there were always an outermost struct this package owned, then that could arrange to only print one screenful, like matrix printing does. But there isn't right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that display
for arrays can insert the ...
in the middle instead of cutting things off at the end based on terminal width. Is there a way to do this but with a custom width like the one specified here?
If you print the status of the example in the docs at the readme, this makes it about 4 screenfuls, instead of 20something. But shows a few numbers so that you can see whether the state is all zero. RFC?