summaryrefslogtreecommitdiff
path: root/src/string_utils.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2018-07-22 15:51:32 +1000
committerMaxime Coste <mawww@kakoune.org>2018-07-22 15:51:32 +1000
commit7b9f162e7d8bccee2eb47cecb4cf0430b9afef2d (patch)
treedeb404928cdd77bc3034f7b3de4731388cb78d95 /src/string_utils.hh
parent019150ba527532e5a7ace10363ab73505c116117 (diff)
Opt-in types for quoting of option lists
This avoid quoting ints in int-lists for example, as they do not risk containing whitespaces. Fixes #2223
Diffstat (limited to 'src/string_utils.hh')
-rw-r--r--src/string_utils.hh1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/string_utils.hh b/src/string_utils.hh
index 558ba62f..0a6c2594 100644
--- a/src/string_utils.hh
+++ b/src/string_utils.hh
@@ -68,6 +68,7 @@ Optional<int> str_to_int_ifp(StringView str);
inline String option_to_string(StringView opt) { return opt.str(); }
inline String option_from_string(Meta::Type<String>, StringView str) { return str.str(); }
inline bool option_add(String& opt, StringView val) { opt += val; return not val.empty(); }
+constexpr bool option_needs_quoting(Meta::Type<String>) { return true; }
template<size_t N>
struct InplaceString