From 8a3613e5a072c4348b70561c21d46da06876e9ba Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Fri, 3 Nov 2023 06:43:44 +0100 Subject: [PATCH] Fix "%val{selections_desc}" being joined by nul instead of space This should fix a bug in lint.kak though I didn't check. --- src/command_manager.cc | 2 +- test/regression/quoted-vals/cmd | 1 + test/regression/quoted-vals/in | 2 ++ test/regression/quoted-vals/out | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 test/regression/quoted-vals/cmd create mode 100644 test/regression/quoted-vals/in create mode 100644 test/regression/quoted-vals/out diff --git a/src/command_manager.cc b/src/command_manager.cc index cfd031b2..07df7336 100644 --- a/src/command_manager.cc +++ b/src/command_manager.cc @@ -377,7 +377,7 @@ void expand_token(Token&& token, const Context& context, const ShellContext& she auto val = ShellManager::instance().get_val(content, context); if constexpr (single) - return set_target(join(val, false, ' ')); + return set_target(join(val, ' ', false)); else return set_target(std::move(val)); } diff --git a/test/regression/quoted-vals/cmd b/test/regression/quoted-vals/cmd new file mode 100644 index 00000000..664c7ea3 --- /dev/null +++ b/test/regression/quoted-vals/cmd @@ -0,0 +1 @@ +:exec "%%c%val{selections_desc}esc>" diff --git a/test/regression/quoted-vals/in b/test/regression/quoted-vals/in new file mode 100644 index 00000000..29625db5 --- /dev/null +++ b/test/regression/quoted-vals/in @@ -0,0 +1,2 @@ +%(sel1) + %(sel2) diff --git a/test/regression/quoted-vals/out b/test/regression/quoted-vals/out new file mode 100644 index 00000000..933d000f --- /dev/null +++ b/test/regression/quoted-vals/out @@ -0,0 +1 @@ +2.2,2.5 1.1,1.4