Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [vi-mode] widgets for case manipulation: `gU` and `U` in visual mode
- X-seq: zsh-workers 38749
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [vi-mode] widgets for case manipulation: `gU` and `U` in visual mode
- Date: Wed, 22 Jun 2016 21:57:22 +0200
- Cc: Filipe Silva <filipe.silva@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1466625443; bh=TgMi0NPQUHD+/WM6URYZxUJ2KrJ7BToMBfzrydfOHUU=; h=In-reply-to:From:References:To:cc:Subject:Date:From:Subject; b=hTFTYdv92VlpIiyy7tGyA+BRvDupfEkA22RBJAvVa6+gxCL5qFM2IxjBh8Ye1biM9Szxhlu/nF1ei62Or6lwTFRc1C32+6BoVB1r8kqTixCHkpjK1hgkkFwjhGLjSwbq8Sre9BQOqpRgq1gXpvXtQw+HpU/yV/uc+0EKcgzKwDjYNtFDDzq5i25KMl0Ou/b997H1rv18EKVYGO5NgDLEZ6lUrAS76jeBxenf+/RzwtTUosfyhHDwqppfUtye4ChciOtX6EL3/ZPvArFCQ/sxLEdlUoC3KEcWLhCpFapDvj+eRpOKCy7SaKJl7xvOSNggQms+7dOxu9LuRxD986E2+w==
- In-reply-to: <160622102929.ZM12262@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAEwkUWMnBO7_6EOo5y5b1eMAZB6uXkgXsh51OqtuEbbUQQPRyQ@mail.gmail.com> <21997.1466550647@thecus.kiddle.eu> <160621234233.ZM10369@torch.brasslantern.com> <CAEwkUWM0O2Wzh1rYPUK4HU3P5MxZHJnA-5NT+Mow_3oMQbtwag@mail.gmail.com> <CAEwkUWNw=oYJs7NV7c8ZTQp+j6CHrtUsDEcMaH+vVVWpdEof_w@mail.gmail.com> <25350.1466608182@thecus.kiddle.eu> <160622102929.ZM12262@torch.brasslantern.com>
Bart wrote:
>
> I think the "surround" widget and/or select-{bracketed.quoted} have the
> same problem:
> - end up with c(ab)de on the line, expected (ab)cde
Yes. Thanks. This should correct that and the ksharrays point you also
made.
Oliver
diff --git a/Functions/Zle/select-bracketed b/Functions/Zle/select-bracketed
index 00f51be..d467bb8 100644
--- a/Functions/Zle/select-bracketed
+++ b/Functions/Zle/select-bracketed
@@ -12,6 +12,8 @@
# done
# done
+setopt localoptions noksharrays
+
local style=${${1:-$KEYS}[1]} matching="(){}[]<>bbBB"
local -i find=${NUMERIC:-1} idx=${matching[(I)[${${1:-$KEYS}[2]}]]}%9
(( idx )) || return 1 # no corresponding closing bracket
diff --git a/Functions/Zle/surround b/Functions/Zle/surround
index b7be30b..8b9ba20 100644
--- a/Functions/Zle/surround
+++ b/Functions/Zle/surround
@@ -69,7 +69,11 @@ case $WIDGET in
before="${(k)matching[(r)[$before:q]]}"
fi
CUTBUFFER="$before$CUTBUFFER$after"
- zle .vi-put-after -n 1
+ if (( CURSOR )); then
+ zle .vi-put-after -n 1
+ else
+ zle .vi-put-before -n 1
+ fi
CUTBUFFER="$save_cut" CURSOR="$save_cur"
;;
esac
Messages sorted by:
Reverse Date,
Date,
Thread,
Author