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

Re: BUG: Matching cause character to be deleted.



Felix Rosencrantz wrote:

> Since, I offered to add the example to the documentation,
> I was starting to look at the suggested matching specification that
> Sven suggested for dealing with anchors between numbers and upper case
> letters, so f2 could match file2, and IR2 could match IndianRed2.
> 
> I found this bug, which is pruned down.
> 
> myprompt@ zsh -f
> host% mkdir j
> host% touch j/{BW,UWB,W} 
> host% bindkey -e; autoload -U compinit; compinit -D
> host% zstyle ':completion:*:complete:*' matcher-list 'r:|[A-Z0-9]=*'
> host% ls j/W<TAB>  #Tab deletes the W, so the line looks like this:
> host% ls j/ 

Oh well. This is a result of 9870. I have to rethink this... (probably 
together with the other possible changes to the matching stuff, if
any).

> Though, the matching specification suggested seems to comes pretty close to
> what I want, it still has some odd behaviors when handling filenames
> that contain upper case words, like ABCdef.  Matching seems to match in the
> middle of words, which doesn't quite feel right.

I fear I don't exactly understand what you say, but I'm pretty sure I
know what you mean ;-)

That's why I sent that follow-up to my reply...

> It would nice if it was possible to specify gaps between characters as anchors,
> even if it would make it more difficult to understand matching specifications.
> (Though, I'm challenged by just writing specifications, I'm not offering to
> modify the code. )

(I can easily understand that you are not offering to modify the
code... sigh.)

If at all, I would do that only for very simple cases, e.g.:

  r:|[^A-Z]|[A-Z]=*

(Note the two `|'s, any suggestions for a better syntax?)

This would mean that the anchor `[^A-Z]|[A-Z]' is the gap between a
non-uppercase or an uppercase letter. The matching itself doesn't look 
too hard. The handling of the clines may be a problem unless... hm.

This would treat the `[^A-Z]' like a left-hand anchor to the
right-hand anchor. I think I'll just have to try it.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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