diff options
| author | Maxime Coste <mawww@kakoune.org> | 2018-05-31 20:59:21 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2018-07-05 07:54:28 +1000 |
| commit | 8b2e5ea862c748e13fbfd49ee3a00c8918d3ee10 (patch) | |
| tree | f29adb218b2e37187efb36089d08f38d039ed959 /src/string_utils.hh | |
| parent | 2729042f83493d76cc9b135c45f326eaf878bec4 (diff) | |
Make selection lists use the option list syntax
Diffstat (limited to 'src/string_utils.hh')
| -rw-r--r-- | src/string_utils.hh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/string_utils.hh b/src/string_utils.hh index bd803536..61a28cad 100644 --- a/src/string_utils.hh +++ b/src/string_utils.hh @@ -128,6 +128,11 @@ StringView format_to(ArrayView<char> buffer, StringView fmt, Types&&... params) return format_to(buffer, fmt, ArrayView<const StringView>{detail::format_param(std::forward<Types>(params))...}); } +inline String quote(StringView s) +{ + return format("'{}'", replace(s, "'", "''")); +} + } #endif // string_utils_hh_INCLUDED |
