mirror of
https://github.com/GothenburgBitFactory/taskshell.git
synced 2025-08-19 00:43:10 +02:00
Review: Truncate long task descriptions in banner.
This commit is contained in:
parent
5bd8886b9e
commit
a4a46dba47
1 changed files with 6 additions and 2 deletions
|
@ -123,10 +123,14 @@ static const std::string banner (
|
|||
<< "] "
|
||||
<< message;
|
||||
|
||||
out << std::string (width - out.str ().length () - 1, ' ');
|
||||
std::string composed = out.str ();
|
||||
if (composed.length () < width)
|
||||
composed += std::string (width - composed.length () - 1, ' ');
|
||||
else
|
||||
composed = composed.substr (0, width - 3) + "...";
|
||||
|
||||
Color color ("white on blue");
|
||||
return color.colorize (out.str ()) + "\n";
|
||||
return color.colorize (composed) + "\n";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue