From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@zsh.org
Cc: Filipe Silva <filipe.silva@gmail.com>
Subject: Re: [vi-mode] widgets for case manipulation: `gU` and `U` in visual mode
Date: Wed, 22 Jun 2016 21:57:22 +0200 [thread overview]
Message-ID: <26566.1466625442@thecus.kiddle.eu> (raw)
In-Reply-To: <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
next prev parent reply other threads:[~2016-06-22 20:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAEwkUWMnBO7_6EOo5y5b1eMAZB6uXkgXsh51OqtuEbbUQQPRyQ@mail.gmail.com>
[not found] ` <21997.1466550647@thecus.kiddle.eu>
[not found] ` <160621234233.ZM10369@torch.brasslantern.com>
[not found] ` <CAEwkUWM0O2Wzh1rYPUK4HU3P5MxZHJnA-5NT+Mow_3oMQbtwag@mail.gmail.com>
[not found] ` <CAEwkUWNw=oYJs7NV7c8ZTQp+j6CHrtUsDEcMaH+vVVWpdEof_w@mail.gmail.com>
[not found] ` <25350.1466608182@thecus.kiddle.eu>
2016-06-22 17:29 ` Bart Schaefer
2016-06-22 19:57 ` Oliver Kiddle [this message]
[not found] ` <CAEwkUWOAvbT4xydtG6EZYRS3tOuur1LZ3tJAx97jR8zgFBjsyw@mail.gmail.com>
[not found] ` <26676.1466626292@thecus.kiddle.eu>
[not found] ` <CAEwkUWPHhDKyzfAUmZaTFGcaW3NOyE_uWTR4Nk1KD0=8jgiFhA@mail.gmail.com>
[not found] ` <CAEwkUWMwSBQhhuQHVOjNqqGUce40kN5f1thvGTriWDo2YB++Cg@mail.gmail.com>
[not found] ` <27903.1466634569@thecus.kiddle.eu>
2016-06-23 4:52 ` Widget musings Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=26566.1466625442@thecus.kiddle.eu \
--to=okiddle@yahoo.co.uk \
--cc=filipe.silva@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).