1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-29 10:02:57 +03:00

rc patch.kak: fix quoting

I learned that

    $ foo="'1

    2'"
    $ echo $foo
    '1 2'

Quote some variables to avoid this double unescaping.
This commit is contained in:
Johannes Altmanninger 2024-01-24 23:57:06 +01:00 committed by Maxime Coste
parent 11e7e2964c
commit 2c944f6415
2 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ define-command diff-jump -params .. -docstring %{
}
set-register a %arg{@}
set-register | %{
[ -n "$kak_reg_a" ] && eval set -- $kak_quoted_reg_a
[ -n "$kak_reg_a" ] && eval set -- "$kak_quoted_reg_a"
cmd=$(column=$kak_reg_c perl -we '
sub quote {
$SQ = "'\''";

View File

@ -52,7 +52,7 @@ define-command patch -params .. -docstring %{
# Since registers are never empty, we get an empty arg even if
# there were no args. This does no harm because we pass it to
# a shell where it expands to nothing.
eval set -- $kak_quoted_reg_a
eval set -- "$kak_quoted_reg_a"
perl "${kak_reg_f%/*}/patch-range.pl" $min_line $max_line "$@" ||
echo >$kak_command_fifo "set-register e fail 'patch: failed to apply selections, see *debug* buffer'"