fix(fs): Only add spacing between shown mountpoints

Fixes #2458
This commit is contained in:
patrick96 2021-07-10 22:08:49 +02:00 committed by Patrick Ziegler
parent c901826317
commit 523e4d6313
1 changed files with 8 additions and 2 deletions

View File

@ -136,10 +136,16 @@ namespace modules {
string output; string output;
for (m_index = 0_z; m_index < m_mounts.size(); ++m_index) { 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); m_builder->space(m_spacing);
output += m_builder->flush();
} }
output += timer_module::get_output(); output += mount_output;
} }
return output; return output;