summaryrefslogtreecommitdiff
path: root/src/face_registry.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2020-08-30 10:12:21 +1000
committerMaxime Coste <mawww@kakoune.org>2020-08-30 10:12:21 +1000
commitf56c1107e00f8e3e82939dbee0fcd5cb7e3ab3c8 (patch)
tree6072ca87e36581173a2e52d5774e691d76b8b04c /src/face_registry.cc
parent9a7d8df44732b684255acd151c4104bf95aeebd5 (diff)
Fix face attributes to string conversion with F shorthand
Previously a `F` attribute would end up being converted to Ffga which is confusing as F *means* fga.
Diffstat (limited to 'src/face_registry.cc')
-rw-r--r--src/face_registry.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/face_registry.cc b/src/face_registry.cc
index 53f059aa..9a70f936 100644
--- a/src/face_registry.cc
+++ b/src/face_registry.cc
@@ -76,8 +76,12 @@ String to_string(Attribute attributes)
};
auto filteredAttrs = attrs |
- filter([=](const Attr& a) { return attributes & a.attr; }) |
- transform([](const Attr& a) { return a.name; });
+ filter([&](const Attr& a) {
+ if ((attributes & a.attr) != a.attr)
+ return false;
+ attributes &= ~a.attr;
+ return true;
+ }) | transform([](const Attr& a) { return a.name; });
return accumulate(filteredAttrs, "+"_str, std::plus<>{});
}