-
Notifications
You must be signed in to change notification settings - Fork 230
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
feat: Add border text functions for top and bottom borders. #384
base: master
Are you sure you want to change the base?
Conversation
this adds callback functions to set text in borders when they are generated.
…r text changed internals to use interface{} so will work with string or String(). border length was not being checked before, now it is limited to the width of the border.
made some changes to names and api so will accept strings and func() string. here is sample..
|
Very nice! We had originally resigned to not including this sort of functionality, but your implementation looks really good. A couple open questions:
Can you also fix the issues pointed out with the linter? |
thanks, I will address the issues in the linter. It looks like a bug. It is intended to limit to the length of the box truncating the texts. Currently, it is first come first served, Left -> Center -> Right. so it is unfair and some may not even be included. I would like to change it to a more fair truncating, where they all get some of the space. Currently they could collide. that will need to be addressed. |
Made some changes to equalize the sizes some and provide space between the labels. Currently does not add ellipsis, may want to add them.
|
Position was not specific enough, could not distinguish between Top and Left, so could not use for side borders. BorderSide currently enum, could possibly be a flag.
This allows to set titles and status information in the borders.
This solves the issue where I keep trying to add some status information to the bottom of a border. I either need to take it apart and rebuild it with the additional information or create my own bottom border. This also allows setting some title information, which is nice too.
this still need some error checking if someone returns longer strings.
Example..
will allow to set functions for each corner