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

Re: bug with hidden prefixes



On Jun 11,  2:09pm, Oliver Kiddle wrote:
}
} _foo() {
}   local ret=1
}   compadd -p /dev/ -M 'r:|/=* r:|=*' one two && ret=0
}   compadd three && ret=0
}   return ret
} }
} compdef _foo foo
} foo /d<tab>
} 
} This should insert /dev/ because it is an unambiguous prefix to both
} possible matches: three can be ruled out. The two matches are listed, it
} is just that the prefix is not inserted. Without either the matching
} control or the third match being there, it works.

Hmm.  When I use this with "compadd three" removed, I get exactly the
same behavior as with it included:

torch% _foo() {    
  local ret=1
  compadd -p /dev/ -M 'r:|/=** r:|=*' one two && ret=0
:  compadd three && ret=0
  return ret
}
torch% foo /d<TAB>
one  two

That is, no prefix is inserted, just the possible matches are listed.
The only way I get different behavior is to remove the -M spec.

torch% _foo() {            
  local ret=1
  compadd -p /dev/ one two && ret=0 
  compadd three && ret=0 
  return ret
}
torch% foo /d<TAB>
torch% foo /dev/

I have no additional clues but perhaps this rules out some red herrings.



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