mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-25 04:24:48 +03:00
parent
dc84cdd538
commit
2bdd361948
@ -330,12 +330,13 @@ String replace(StringView str, StringView substr, StringView replacement);
|
||||
template<typename Container>
|
||||
String join(const Container& container, char joiner, bool esc_joiner = true)
|
||||
{
|
||||
const char to_escape[] = { joiner, '\\' };
|
||||
String res;
|
||||
for (const auto& str : container)
|
||||
{
|
||||
if (not res.empty())
|
||||
res += joiner;
|
||||
res += esc_joiner ? escape(str, joiner, '\\') : str;
|
||||
res += esc_joiner ? escape(str, to_escape, '\\') : str;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
1
test/regression/1014-ambiguous-kak_selections/cmd
Normal file
1
test/regression/1014-ambiguous-kak_selections/cmd
Normal file
@ -0,0 +1 @@
|
||||
%<a-s>H
|
3
test/regression/1014-ambiguous-kak_selections/in
Normal file
3
test/regression/1014-ambiguous-kak_selections/in
Normal file
@ -0,0 +1,3 @@
|
||||
foo\:bar
|
||||
foo\\
|
||||
bar
|
1
test/regression/1014-ambiguous-kak_selections/selections
Normal file
1
test/regression/1014-ambiguous-kak_selections/selections
Normal file
@ -0,0 +1 @@
|
||||
foo\\\:bar:foo\\\\:bar
|
Loading…
Reference in New Issue
Block a user