fzy
terminal fuzzy finder picker
git clone https://9o.is/git/fzy.git
commit 69cbd7e19cd0c708f53148b975e9d11636ad4c22 parent 921a0368b3bbe80ff2ca64ebe02c2d12b9729c64 Author: John Hawthorn <john.hawthorn@gmail.com> Date: Thu, 17 Jul 2014 21:48:06 -0700 Don't treat consecitive capitals as BOW Only treat the first letter of an ALLCAPS word as the biginning of that word (it is not CamelCase). Diffstat:
| M | match.c | | | 4 | +++- |
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/match.c b/match.c @@ -58,11 +58,13 @@ double calculate_score(const char *needle, const char *haystack){ /* Which positions are beginning of words */ int at_bow = 1; + char last_ch = '\0'; for(int i = 0; i < m; i++){ char ch = haystack[i]; /* TODO: What about allcaps (ex. README) */ - bow[i] = (at_bow && isalnum(ch)) || isupper(ch); + bow[i] = (at_bow && isalnum(ch)) || (isupper(ch) && !isupper(last_ch)); at_bow = !isalnum(ch); + last_ch = ch; } for(int i = 0; i < n; i++){