From b14e55f7295361e4ef7f5505aa3987e9b91036c6 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Tue, 22 Nov 2016 23:10:35 +0100 Subject: [PATCH] fix(label): Do not erase false positives --- src/drawtypes/label.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/drawtypes/label.cpp b/src/drawtypes/label.cpp index 71e8d655..b78500bd 100644 --- a/src/drawtypes/label.cpp +++ b/src/drawtypes/label.cpp @@ -88,12 +88,13 @@ namespace drawtypes { while ((start = line.find('%')) != string::npos && (end = line.find('%', start + 1)) != string::npos) { auto token = line.substr(start, end - start + 1); - line.erase(start, end - start + 1); - // ignore false positives (lemonbar-style declarations) - if (token[1] == '{') + if (token[1] == '{') { + line.erase(0, start + 1); continue; + } + line.erase(start, end - start + 1); bound.emplace_back(bounds{token, 0, 0}); // find min delimiter