Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: transpose-words-match (Re: New widget "transpose-segments")



On 9 January 2016 at 18:48, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Jan 9,  9:22am, I asked:
> }
> } How does this differ from
> }
> }     zle -N transpose-words transpose-words-match
>
> One difference is that transpose-words-match uses a little more context,
> so
>
>     % echo two words<alt-t>
>
> does not transpose because the cursor is not between two words, and
>
>     % echo "two <alt-t>words"
>     % echo words" "very
>
> swaps around the space even though it is in the middle of a "shell word".

That's a nice catch, finally a de facto difference between
transpose-words-match and transpose-segments. I tried lines like:

$(( i+1 )) a="${(u)a}" 試句相當長

and they worked the same. Now it can be seen that what you described
can also occur inside $(( )).

Best regards,
Sebastian Gniazdowski



Messages sorted by: Reverse Date, Date, Thread, Author