/cc @alerque
- Ask for user confirmation before running `install --bin`
- Removed `s:fzf_rb` since `install --bin` will create a wrapper
executable that just runs Ruby version on the platforms where prebuilt
binaries are not available.
1. Go binary: ../bin/fzf
2. System fzf: $(which fzf)
3. Download fzf from GitHub or create wrapper script to Ruby version (../fzf)
when the binary for the platform is not available
4. If install script is not found or for some reason failed, try to use Ruby
version in its expected location (../fzf)
5. If fzf is found to be a shell function, use it (type fzf)
- dark: the current default for 256-color terminal
- light: color scheme for 256-color terminal with light background
- 16: the default color scheme for 16-color terminal (`+2`)
- bw: no colors (`+c`)
I profiled fzf and it turned out that it was spending significant amount
of time repeatedly converting character arrays into Unicode codepoints.
This commit greatly improves search performance after the initial scan
by memoizing the converted results.
This commit also addresses the problem of unbounded memory usage of fzf.
fzf is a short-lived process that usually processes small input, so it
was implemented to cache the intermediate results very aggressively with
no notion of cache expiration/eviction. I still think a proper
implementation of caching scheme is definitely an overkill. Instead this
commit introduces limits to the maximum size (or minimum selectivity) of
the intermediate results that can be cached.