From 4ea188b3f93290aeb30ddfc5ce920fe14d605858 Mon Sep 17 00:00:00 2001
From: patrick96
Date: Thu, 22 Aug 2019 00:55:13 +0200
Subject: [PATCH] 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
---
include/modules/meta/base.inl | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/modules/meta/base.inl b/include/modules/meta/base.inl
index ce37e137..ec68d5ab 100644
--- a/include/modules/meta/base.inl
+++ b/include/modules/meta/base.inl
@@ -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;