fix(modules): Only add reset tag on non-empty modules

Adding the reset tag to empty modules makes polybar add margins and
separators for that empty module.

Fixes #1857

Ref #1596
This commit is contained in:
patrick96 2019-08-22 00:55:13 +02:00 committed by Patrick Ziegler
parent 211b0bbfd8
commit 4ea188b3f9
1 changed files with 5 additions and 3 deletions

View File

@ -82,9 +82,11 @@ namespace modules {
m_cache = CAST_MOD(Impl)->get_output();
// Make sure builder is really empty
m_builder->flush();
// Add a reset tag after the module
m_builder->control(controltag::R);
m_cache += m_builder->flush();
if (!m_cache.empty()) {
// Add a reset tag after the module
m_builder->control(controltag::R);
m_cache += m_builder->flush();
}
m_changed = false;
}
return m_cache;