summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2019-06-27 22:42:12 +1000
committerMaxime Coste <mawww@kakoune.org>2019-06-27 22:42:12 +1000
commite4d6bff5ec1a6bf3a3456e26d51e53d85c282ea0 (patch)
tree111855cd65df8826790db321825be8d119394de8
parent196b38b2e0b8c8babfeffec786ef9ad948e976e6 (diff)
Fix quoting of tuple options
Fixes #2990
-rw-r--r--src/option_types.hh2
-rw-r--r--test/shell/quoted-range/cmd1
-rw-r--r--test/shell/quoted-range/in1
-rw-r--r--test/shell/quoted-range/out1
-rw-r--r--test/shell/quoted-range/rc1
5 files changed, 5 insertions, 1 deletions
diff --git a/src/option_types.hh b/src/option_types.hh
index 5c7b2a9f..c0f138ea 100644
--- a/src/option_types.hh
+++ b/src/option_types.hh
@@ -174,7 +174,7 @@ constexpr char tuple_separator = '|';
template<typename... Types, size_t... I>
String option_to_string_impl(Quoting quoting, const std::tuple<Types...>& opt, std::index_sequence<I...>)
{
- return join(make_array({option_to_string(std::get<I>(opt), quoting)...}), tuple_separator);
+ return quoter(quoting)(join(make_array({option_to_string(std::get<I>(opt), Quoting::Raw)...}), tuple_separator));
}
template<typename... Types>
diff --git a/test/shell/quoted-range/cmd b/test/shell/quoted-range/cmd
new file mode 100644
index 00000000..0a2faf6b
--- /dev/null
+++ b/test/shell/quoted-range/cmd
@@ -0,0 +1 @@
+!printf '%s' "$kak_quoted_opt_my_ranges"<ret>
diff --git a/test/shell/quoted-range/in b/test/shell/quoted-range/in
new file mode 100644
index 00000000..8b137891
--- /dev/null
+++ b/test/shell/quoted-range/in
@@ -0,0 +1 @@
+
diff --git a/test/shell/quoted-range/out b/test/shell/quoted-range/out
new file mode 100644
index 00000000..2488b23f
--- /dev/null
+++ b/test/shell/quoted-range/out
@@ -0,0 +1 @@
+1 '1.1,1.1|a b' '1.2,1.2|b c'
diff --git a/test/shell/quoted-range/rc b/test/shell/quoted-range/rc
new file mode 100644
index 00000000..d88fab4c
--- /dev/null
+++ b/test/shell/quoted-range/rc
@@ -0,0 +1 @@
+declare-option range-specs my_ranges 1 '1.1,1.1|a b' '1.2,1.2|b c'