From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13951 invoked by alias); 22 Jun 2016 20:04:22 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 38749 Received: (qmail 14992 invoked from network); 22 Jun 2016 20:04:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 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== X-Yahoo-Newman-Id: 844124.25734.bm@smtp115.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: k0A7KHUVM1nyntdboldnW5j2BheXvdk1aP5h2AFhYGRivGO tFSZccfPtIr2cAnsGpT51dQLe5phg2UagpMKY3EGE1fF1JHj4d926DhRzDgx 3s72M7X1AKRvC1pVHJc8u_.hBrI7ulMXxc._UqfbrijNKcUoJ.HYspSUlov0 YxIyVEJJkP7La5EfupHNT.zCCqD19_7KyS5pITO3I33OhAgfgLDT1M1KS3X. TR0YhZJVUq27T7F9A86T3FE5PLOECoLiaN_dTGRoT_46y1BgaA1FVoitNJwY PLDQUOmgxV0XQNUCUvj8w2zk3WNXfNZnAdusQNCVmo88rugLSPnp5nlpqsCq bjpBtEU2k8r1qmopFjWIUndEi2Nvbdv4vpgVh0H6P3NmdOwQwM0k.g5BnWAE HhzDkORDwRDvrUUfeprzB38G8q2zIRIyngAgY4JUQmDLflPyAXgd1gDFvmai tFrdIoEDc8omYRXHTMGxMhUV4o42LAKC9jC1bGwiZDzWPmQ2n2cA2SOg__9_ yPUo2LqyQz61XOhlSmO_xakpweyEbrA-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <160622102929.ZM12262@torch.brasslantern.com> From: Oliver Kiddle References: <21997.1466550647@thecus.kiddle.eu> <160621234233.ZM10369@torch.brasslantern.com> <25350.1466608182@thecus.kiddle.eu> <160622102929.ZM12262@torch.brasslantern.com> To: zsh-workers@zsh.org cc: Filipe Silva Subject: Re: [vi-mode] widgets for case manipulation: `gU` and `U` in visual mode MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26565.1466625442.1@thecus.kiddle.eu> Date: Wed, 22 Jun 2016 21:57:22 +0200 Message-ID: <26566.1466625442@thecus.kiddle.eu> 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