Subject: $( <Tab> has CURRENT=1, $(( <Tab> has CURRENT=0
From: Sebastian Gniazdowski <[email-masked]>
To: Zsh hackers list <[email-masked]>
Date: Thu, 14 Jan 2016 10:19:15 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

Hello,
in both cases words array is empty, so CURRENT=0 seems to be more
logical value. Maybe something bigger is hidden behind this.

Here is a test code that might be employed to see this:

https://github.com/psprint/zsh-editing-workbench/blob/de33867898643e6161dd172db6f8bab42f73083d/widen_for_history

It's enabled with:
autoload widen_for_history
zle -N widen_for_history
zstyle ':completion:*' completer widen_for_history _complete

Outputs of the code for $( <Tab> and $(( <Tab>

A CURRENT: 1, words: ><
B CURRENT: 1, words: >$( <
C CURRENT: 1, CURSR: 2, lft: |$(|, rght: ||, words: >$(<
PREFIX: |$(|, SUFFIX: ||
Calling _history
$(( 0 + 1 )) $(( 0 + 1 )) $(( 試句相當長 ""  $(( 0 + 1 )) $( ( echo b ))
$(( echo b ) ) $(( echo a ) ) $(( 0 + 1 )) $(( 0 + 1 )) $(( i + 1 ))
$(( i + 1 )) $(( i + 1 )) $(( i+1 )) $(( i+1 )) $(( i+1 )) $(( i+1 ))
$(( i+1 ))

A CURRENT: 0, words: ><
B CURRENT: 0, words: >$(( <
C CURRENT: 1, CURSR: 4, lft: |$((|, rght: ||, words: >$((<
PREFIX: |$((|, SUFFIX: ||
Calling _history
$(( 0 + 1 )) $(( 0 + 1 )) $(( 試句相當長 ""  $(( 0 + 1 )) $(( echo b ) )
$(( echo a ) ) $(( 0 + 1 )) $(( 0 + 1 )) $(( i + 1 )) $(( i + 1 )) $((
i + 1 )) $(( i+1 )) $(( i+1 )) $(( i+1 )) $(( i+1 )) $(( i+1 ))

Best regards,
Sebastian Gniazdowski