From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10000 invoked by alias); 22 Jun 2016 13:23:40 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21692 Received: (qmail 6488 invoked from network); 22 Jun 2016 13:23:39 -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, HTML_MESSAGE,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=kVBrLuYf6pe3c4DDWY52LL5HXN+uxLn8moTSri9FIbI=; b=Z9F1EKg0JgppJ+m7OG/1qumtMytorIkzAVeDJrPayEVWrr6DQ3ULeeLA1HSBDMrR/d Z5b0iZKSZi4jdbDXcNhdkzuZ2Fiiw+GC8mf38YoPBNRyNhYaOw8L/CVYV6+ZbeYMpol/ MjLaktZUG26BA0Vvzf1A2l4JLEm1sbONwbbwQu4KTR3GHzKt2nkMIYd3MQqNCrLJv5Vd NHodNNYwIWVLWwFUW40ycYle9kynRHeKDsbITA83ref8gai/jdv5A3l5GeMjnl3v9iLA R4y1TV9Ny5RRB7ijkXsKtdEkQ0lKYt12c6mFIlJRmxsqB816ZU8TMhugcBQz+WU5FISD S5Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=kVBrLuYf6pe3c4DDWY52LL5HXN+uxLn8moTSri9FIbI=; b=gokFBZBiJkaBPEdX6+Ngf9SJ5uqWxe5/pCi3Fx90HRxiNfkAgQkKkOtk+3ZDwReqZN 7JqWI8kBJGMkz48H53NX1cvJmXejTywrz/5vpgQSAN2ZuMur6Rxqpt3fL56OMcw8+TYQ 9Tf26EFni27bIH3N44ImeBdeM0f+8Jopu4+0NLo/mXXb672HzWrH63aaFcaLqTRImB/t CM029M6UQZUoQdrhJATVpd9QcmJ5Gc3JNpWlAk4qTO5K5YmO+YvYwdY6pfnonXCljlB1 O7bfaeBzPwc29ObtWP/TpQXcgLr2iPwwwx9pMwkiuZDDrDLSY19aMfxuxyPMcHj1gyAc pWrA== X-Gm-Message-State: ALyK8tKdMY5s6U4fAvbWLwii89XqApf3PjiAw5/I9MVFJKZwLycTMWj1FzRDdLMctAk/EX2HicG/0F8KKz8DoQ== X-Received: by 10.202.2.7 with SMTP id 7mr1497029oic.155.1466601817896; Wed, 22 Jun 2016 06:23:37 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <21997.1466550647@thecus.kiddle.eu> <160621234233.ZM10369@torch.brasslantern.com> From: Filipe Silva Date: Wed, 22 Jun 2016 10:23:37 -0300 Message-ID: Subject: Re: [vi-mode] widgets for case manipulation: `gU` and `U` in visual mode To: Bart Schaefer Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=001a1137b4e061fe0c0535ddd821 --001a1137b4e061fe0c0535ddd821 Content-Type: text/plain; charset=UTF-8 Now that 5.0.8 and text objects were mentioned, I think there's a bug with the `surround` widget. Or maybe just the usage instructions are incorrect. here are the usage instructions of the `surround` widget on zsh master: https://github.com/zsh-users/zsh/blob/master/Functions/Zle/surround#L4-L12 # Implementation of some functionality of the popular vim surround plugin. # Allows "surroundings" to be changes: parentheses, brackets and quotes. # To use # autoload -Uz surround # zle -N delete-surround surround # zle -N add-surround surround # zle -N change-surround surround # bindkey -a cs change-surround # bindkey -a ds delete-surround # bindkey -a ys add-surround # bindkey -M visual S add-surround If I add this to my vi-mode zsh plugin, it does nothing. for instance, the `ys` chord is not being picked up. supose i have a word: `abcde` and the cursor is in `c`. if I'm in normal mode and type `ys` zle thinks that I've hit `s` and deletes the `c` character and puts me in insert mode. Maybe it's a bug? On Wed, Jun 22, 2016 at 10:19 AM, Filipe Silva wrote: > Hi Oliver, thanks for sharing the widgets. You should know that there's a > bug in both widgets in an edge case: > > suppose you have the word `abc` and `a` is the first char of the line. > also suppose you've select just the `ab` of the `abc` word and then hit > `U`: > > > ``` > # [ab] is the visually selected text > > $ [ab]c > ``` > > after you hit `U` the result is > > ``` > $ cAB > ``` > > I've fixed the bug including the following condition: > > if [[ $save_cur = '1' ]]; then > zle .vi-put-before -n 1 > else > zle .vi-put-after -n 1 > fi > > > > On Wed, Jun 22, 2016 at 3:42 AM, Bart Schaefer > wrote: > >> On Jun 22, 1:10am, Oliver Kiddle wrote: >> } >> } Some of the text objects were done via shell widgets - select-quoted and >> } select-bracketed which select text between delimiters. >> >> Incidentally, I think select-bracketed might break given ksharrays -- >> select-quoted explictly turns ksharrays off. >> > > --001a1137b4e061fe0c0535ddd821--