From 523e4d6313b784c0790d8481bf38604c1febc27c Mon Sep 17 00:00:00 2001 From: patrick96 Date: Sat, 10 Jul 2021 22:08:49 +0200 Subject: [PATCH] fix(fs): Only add spacing between shown mountpoints Fixes #2458 --- src/modules/fs.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/modules/fs.cpp b/src/modules/fs.cpp index 368d327e..0073eca8 100644 --- a/src/modules/fs.cpp +++ b/src/modules/fs.cpp @@ -136,10 +136,16 @@ namespace modules { string output; for (m_index = 0_z; m_index < m_mounts.size(); ++m_index) { - if (!output.empty()) { + string mount_output = timer_module::get_output(); + /* + * Add spacing before the mountpoint, but only if the mountpoint contents + * are not empty and there is already other content in the module. + */ + if (!output.empty() && !mount_output.empty()) { m_builder->space(m_spacing); + output += m_builder->flush(); } - output += timer_module::get_output(); + output += mount_output; } return output;