make matching behavior slightly more intuitive#157
make matching behavior slightly more intuitive#157tlilyh wants to merge 1 commit intorupa:masterfrom
Conversation
a path is now considered to match a regex iff at least part of the regex matches the basename of the path - this obviates the need for the common function, since now if there is a common parent path, it will usually be the best match.
|
I was wondering if anyone had a fix for this behavior, using |
|
yeah, i should really think about merging this. at the very least, it gets rid of the code i hate most. definitely some "i have this problem and this fixes it and doesn't make anything else worse" comments help :) |
|
I’ll put it on my computer and test it for a week or two, I use z a handful of times a day so I think it would be a decent indicator of real world use. Thank you! Edit: There have been significant changes since this was submitted, I'll try to get all the changes into a branch that works first. Then I'll test it out |
normal z matching behavior, especially with respect to the
common()function, is a little odd:In fact, if an unrelated path matching
/aaa/is in z's database, andaaa/bbbis of higher frecency thanaaa, there is no way to jump toaaawithout also jumping deeper intoaaa/bbb.This patch changes the matching behavior so z will only jump to a deeper directory if it is explicitly matched - e.g.,
z aaawill never jump below the directory matchingaaa, which I find to be slightly more intuitive.