From c36daa4d7da13b2846e37fe4ed1a3c12c73abcc0 Mon Sep 17 00:00:00 2001 From: lethosor Date: Fri, 9 Jan 2015 20:02:44 -0500 Subject: [PATCH] Fix a few minor StringFormatter issues * Recognize the end of a format specifier properly * Make '$' actually work --- plugins/manipulator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/manipulator.cpp b/plugins/manipulator.cpp index 409411e30..d1bbdd8f1 100644 --- a/plugins/manipulator.cpp +++ b/plugins/manipulator.cpp @@ -439,6 +439,7 @@ public: } if (!candidates.size()) return ""; + // Select the longest candidate std::sort(candidates.begin(), candidates.end(), StringFormatter::compare_opts); return candidates[0]; } @@ -476,7 +477,8 @@ public: if (func != NULL) dest += func(obj); i += opt.size(); - if (i < opt.size() && opt[i] == '$') + in_opt = false; + if (i < fmt.size() && fmt[i] == '$') // Allow $ to terminate format options i++; }