diff options
| author | Frank LENORMAND <lenormf@gmail.com> | 2016-09-24 12:22:09 +0300 |
|---|---|---|
| committer | Frank LENORMAND <lenormf@gmail.com> | 2016-09-29 09:55:44 +0300 |
| commit | 6ae1eaf97c018d28f66fdf697c9f559a67c93702 (patch) | |
| tree | b9fbca53abe0959379481f7a849cd5b05ffc91fb | |
| parent | 843d03f2e7ea9b0530cd435ccca3a236ed302594 (diff) | |
Adapt to recent changes to `exec`'s behavior, remove non POSIX double brackets
| -rw-r--r-- | rc/base/autowrap.kak | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/rc/base/autowrap.kak b/rc/base/autowrap.kak index 0b7bc44b..18eaf6b9 100644 --- a/rc/base/autowrap.kak +++ b/rc/base/autowrap.kak @@ -16,18 +16,20 @@ def -hidden autowrap-cursor %{ eval -save-regs '/"|^@m' %{ reg m "%val{selections_desc}" ## if we're adding characters past the limit, just wrap them around - exec -draft "<a-h><a-k>.{%opt{autowrap_column}}\h*[^\s]*<ret>1s(\h+)[^\h]*\'<ret>c<ret><esc>" + exec -draft "<a-h><a-k>.{%opt{autowrap_column}}\h*[^\s]*<ret>1s(\h+)[^\h]*\'<ret>c<ret>" } catch %{ ## if we're adding characters in the middle of a sentence, use ## the `fmtcmd` command to wrap the entire paragraph %sh{ - if [[ "${kak_opt_autowrap_format_paragraph}" = true ]] \ - && [[ -n "${kak_opt_autowrap_fmtcmd}" ]]; then + if [ "${kak_opt_autowrap_format_paragraph}" = true ] \ + && [ -n "${kak_opt_autowrap_fmtcmd}" ]; then format_cmd=$(printf %s "${kak_opt_autowrap_fmtcmd}" \ | sed "s/%c/${kak_opt_autowrap_column}/g") printf %s " - exec '<a-]>p<a-x><a-j>|${format_cmd}<ret>' - try %{ exec s\h+$<ret> d } + eval -draft %{ + exec '<a-]>p<a-x><a-j>|${format_cmd}<ret>' + try %{ exec s\h+$<ret> d } + } select '${kak_reg_m}' " fi |
