From 512185a6b388fb0bee2c24ccc464945890e124dd Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Thu, 2 Apr 2015 14:14:09 +0200 Subject: [PATCH] Don't print trailing whitespace for last element it's easier to add it in your tmux.conf, then it's to remove it. --- common/load.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/load.cc b/common/load.cc index 6dc3fe7..ff1c494 100644 --- a/common/load.cc +++ b/common/load.cc @@ -61,7 +61,15 @@ std::string load_string( bool use_colors = false ) { // Round to nearest, make sure this is only a 0.00 value not a 0.0000 float avg = floorf( static_cast( averages[i] ) * 100 + 0.5 ) / 100; - ss << avg << " "; + // Don't print trailing whitespace for last element + if ( i == nelem-1 ) + { + ss << avg; + } + else + { + ss << avg << " "; + } } if( use_colors )