- TW-1534 Urgency coefficient for user project disables 'info' output(thanks to
          Martin).
- Reimplemented 'information' command urgency details as a ViewText.
- Fixed math bug in rightJustify.
This commit is contained in:
Paul Beckingham 2015-02-14 12:50:10 -05:00
parent 5911286218
commit ec919a8677
5 changed files with 107 additions and 73 deletions

View file

@ -985,7 +985,11 @@ std::string rightJustify (const int input, const int width)
////////////////////////////////////////////////////////////////////////////////
std::string rightJustify (const std::string& input, const int width)
{
return std::string (width - utf8_text_width (input), ' ') + input;
unsigned int len = utf8_text_width (input);
return ((width > len)
? std::string (width - len, ' ')
: "")
+ input;
}
////////////////////////////////////////////////////////////////////////////////