summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2024-01-05 15:25:51 +1100
committerMaxime Coste <mawww@kakoune.org>2024-01-05 15:25:51 +1100
commit91d6ac013f8f04e7380fe945ef614eb4672bf9fd (patch)
tree2016b33c93648d46bdf03415d32039a3c7b5ebcc
parenteed3aa24c138ec8e848ecb5b4baa9632592f13b5 (diff)
parent1ce639f2f990cb9bc005a705ab3b5b39a4a01ad0 (diff)
Merge remote-tracking branch 'krobelus/fix-with-option'
-rw-r--r--rc/windowing/detection.kak17
1 files changed, 11 insertions, 6 deletions
diff --git a/rc/windowing/detection.kak b/rc/windowing/detection.kak
index a3af2349..9e9f2f64 100644
--- a/rc/windowing/detection.kak
+++ b/rc/windowing/detection.kak
@@ -63,12 +63,17 @@ define-command with-option -params 3.. -docstring %{
evaluate-commands -save-regs s %{
evaluate-commands set-register s %exp{%%opt{%arg{1}}}
set-option current %arg{1} %arg{2}
- evaluate-commands %sh{
- shift 2
- for arg
- do
- printf "'%s' " "$(printf %s "$arg" | sed "s/'/''/g")"
- done
+ try %{
+ evaluate-commands %sh{
+ shift 2
+ for arg
+ do
+ printf "'%s' " "$(printf %s "$arg" | sed "s/'/''/g")"
+ done
+ }
+ } catch %{
+ set-option current %arg{1} %reg{s}
+ fail "with-option: %val{error}"
}
set-option current %arg{1} %reg{s}
}