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

Re: Bug w/matching control + feature request



I've been using the new cycle completion positions code a little and
encountered a couple of small glitches.

Here's one case where the insert_positions doesn't have all the positions.

Using the following test case with zsh -f:
autoload -U compinit cycle-completion-positions ; compinit -D
compdef _tst tst
_tst () {compadd -M 'r:|[.,_-]=**' A.B.C  A.B.C.D  A.C}
zle -N cycle cycle-completion-positions
bindkey "^T" cycle
tst A.C<TAB>

At this point the value of $_lastcomp[insert_positions] is only 7, after the
last character.  It should have one more value on the first dot.  
I've sort of expected that insert_positions might not always list all
positions, though I thought it would be worth mentioning.  (I was thinking I
could be useful by adding "insert_positions" output to the 54compmatch.ztst
test, such that all the cases reported it's value.  Would this be worthwhile? )


Another situation occurs with a character being deleted.  This one is partly
due to my matching spec being complicated, but it seems like the character
shouldn't be deleted.  Again run it through zsh -f.  

autoload -U compinit cycle-completion-positions ; compinit -D
compdef _tst tst
_tst () {
compadd -M 'r:|[.,_-]=** r:[^0-9]||[0-9]=**'  a-b_1_2_2  a-b_2_0.gz 
a-b_2_0.zip}
tst a-b_2<TAB>  --> tst a-b__ 

The 2 is deleted.


>the position after the word is always
>unconditionally added (that seemed sensible, even if there may be
>cases when there is nothing missing at the end).

Also, I was wondering if it would make sense to somehow distinguish between
cases where the end of word position is and isn't missing something.  So it
would be possible to configure cycle-completion-positions not to go to eow
if it wasn't a hot spot.  It seems there is a difference that might be
useful to report.

This might be implemented by adding 2 colon's before that value in
insert_positions, if it wasn't missing something.  Then it would be easy
to remove the extra colon, if the eow is always wanted. Or it would be easy
to remove the eow value if it is not wanted as a cycle point
when nothing is missing.


-FR


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/



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