summaryrefslogtreecommitdiff
path: root/src/util
AgeCommit message (Collapse)Author
2020-03-30Update AtomicBool to use atomic memory operation (#1939)Alexandr
2020-03-01Fix prefix/suffix/equal matcher to trim whitespacesJunegunn Choi
- Prefix matcher will trim leading whitespaces only when the pattern doesn't start with a whitespace - Suffix matcher will trim trailing whitespaces only when the pattern doesn't end with a whitespace - Equal matcher will trim leading whitespaces only when the pattern doesn't start with a whitespace, and trim trailing whitespaces only when the pattern doesn't end with a whitespace Previously, only suffix matcher would trim whitespaces unconditionally. Fix #1894
2019-12-09Defer resetting multi-selection on reloadJunegunn Choi
2019-11-12Remove trailing whitespaces when using --with-nthJunegunn Choi
2019-07-19Code cleanup (#1640)Christian Muehlhaeuser
- Replaced time.Now().Sub() with time.Since() - Replaced unnecessary string/byte slice conversions - Removed obsolete return and value assignment in range loop
2019-03-07Always prepend ANSI reset code before re-assembling tokensJunegunn Choi
2019-03-06Preserve the original color of each token when using --with-nth with --ansiJunegunn Choi
Close #1500
2018-10-070.17.5Junegunn Choi
2018-09-28Kill running preview process after 500ms when focus has changedJunegunn Choi
Close #1383 Close #1384
2018-04-12Do not print non-displayable charactersJunegunn Choi
fzf used to print non-displayable characters (ascii code < 32) as '?', but we will simply ignore those characters with this patch, just like our terminals do. \n and \r are exceptions. They will be printed as a space character. TODO: \H should delete the preceding character, but this is not implemented. Related: #1253
2018-03-13Make fzf pass go vetRyan Boehning
Add String() methods to types, so they can be printed with %s. Change some %s format specifiers to %v, when the default string representation is good enough. In Go 1.10, `go test` triggers a parallel `go vet`. So this also makes fzf pass `go test`. Close #1236 Close #1219
2018-01-17Update Windows default command to print relative paths (#1200)Jan Edmund Lazo
2017-10-15Fix compilation error of Windows binaryJunegunn Choi
2017-10-14Fix ExecCommandWith for cmd.exe in Windows (#1072)Jan Edmund Lazo
Close #1018 Run the command as is in cmd.exe with no parsing and escaping. Explicity set cmd.SysProcAttr so execCommand does not escape the command. Technically, the command should be escaped with ^ for special characters, including ". This allows cmd.exe commands to be chained together. See https://github.com/neovim/neovim/pull/7343#issuecomment-333350201 This commit also updates quoteEntry to use strings.Replace instead of strconv.Quote which escapes more than \ and ".
2017-09-28Update FZF_DEFAULT_COMMANDJunegunn Choi
- Use bash for `set -o pipefail` - Fall back to simpler find command when the original command failed Related: #1061
2017-08-26Minor refactoringsJunegunn Choi
2017-08-20Ignore EvtReadNew if EvtReadFin is already setJunegunn Choi
2017-08-20Remove redundant read event when --sync is usedJunegunn Choi
2017-08-01Modify loop conditions in checkAscii functionJunegunn Choi
2017-08-01Do not use defer in performance-sensitive contextsJunegunn Choi
2017-07-30Optimize fuzzy search performance for ASCII stringsJunegunn Choi
2017-07-20Avoid unconditionally storsing input as runesJunegunn Choi
When --with-nth is used, fzf used to preprocess each line and store the result as rune array, which was wasteful if the line only contains ascii characters.
2017-07-18Speed up initial scanning with bitwise AND operationJunegunn Choi
2017-07-16Reduce memory footprint of Item structJunegunn Choi
2017-06-03Fixes for CygwinJunegunn Choi
- Update install script to download Windows binary if $TERM == cygwin - Unset TERM if $TERM == cygwin (#933) - Always use cmd.exe instead of $SHELL when running commands
2017-06-01Use glide to handle go dependenciesEdgar Lee
2017-05-25Use read syscall directly to get character (#931)Tw
Due to go std lib uses poller for os.File introducing in this commit: https://github.com/golang/go/commit/c05b06a12d005f50e4776095a60d6bd9c2c91fac There are two changes to watch out: 1. os.File.Fd will always return a blocking fd except on bsd. 2. os.File.Read won't return EAGAIN error for nonblocking fd. So For 1, we just get tty's fd in advance and then set its block mode. For 2, we use read syscall directly to get what we wanted error(EAGAIN). Fix issue #910. Signed-off-by: Tw <tw19881113@gmail.com>
2017-01-09Make util.RuneWidth return 1 for non-displayable charactersJunegunn Choi
Fix line wrapping in preview window
2017-01-08Add --height optionJunegunn Choi
2016-11-08Fix issues in tcell renderer and Windows buildJunegunn Choi
- Fix display of CJK wide characters - Fix horizontal offset of header lines - Add support for keys with ALT modifier, shift-tab, page-up and down - Fix util.ExecCommand to properly parse command-line arguments - Fix redraw on resize - Implement Pause/Resume for execute action - Remove runtime check of GOOS - Change exit status to 2 when tcell failed to start - TBD: Travis CI build for tcell renderer - Pending. tcell cannot reliably ingest keys from tmux send-keys
2016-11-07Prepare for termbox/windows buildJunegunn Choi
`TAGS=termbox make` (or `go build -tags termbox`)
2016-09-29Use unicode.IsSpace to cover more whitespace charactersJunegunn Choi
2016-09-18Revise ranking algorithmJunegunn Choi
2016-08-19Micro-optimizationsJunegunn Choi
- Make structs smaller - Introduce Result struct and use it to represent matched items instead of reusing Item struct for that purpose - Avoid unnecessary memory allocation - Avoid growing slice from the initial capacity - Code cleanup
2016-08-14[perf] evaluateBonus can start from sidx - 1Junegunn Choi
2016-08-14[perf] Remove memory copy when using string delimiterJunegunn Choi
2016-08-14[perf] Optimize AWK-style tokenizer for --nthJunegunn Choi
Approx. 50% less memory footprint and 40% improvement in query time
2016-08-14[perf] Avoid allocating rune array for ascii stringJunegunn Choi
In the best case (all ascii), this reduces the memory footprint by 60% and the response time by 15% to 20%. In the worst case (every line has non-ascii characters), 3 to 4% overhead is observed.
2016-03-02Add --hscroll-off=COL optionJunegunn Choi
Close #513
2016-02-07Use $SHELL to start $FZF_DEFAULT_COMMAND (#481)Junegunn Choi
2015-10-02Use trimmed length when --nth is used with --tiebreak=lengthJunegunn Choi
This change improves sort ordering for aligned tabular input. Given the following input: apple juice 100 apple pie 200 fzf --nth=2 will now prefer the one with pie. Before this change fzf compared "juice " and "pie ", both of which have the same length.
2015-08-02GoLintJunegunn Choi
2015-08-02Performance fix - unnecessary rune convertion on --ansiJunegunn Choi
> time cat /tmp/list | fzf-0.10.1-darwin_amd64 --ansi -fqwerty > /dev/null real 0m4.364s user 0m8.231s sys 0m0.820s > time cat /tmp/list | fzf --ansi -fqwerty > /dev/null real 0m4.624s user 0m5.755s sys 0m0.732s
2015-08-02Performance tuning - eager rune array conversionJunegunn Choi
> wc -l /tmp/list2 2594098 /tmp/list2 > time cat /tmp/list2 | fzf-0.10.1-darwin_amd64 -fqwerty > /dev/null real 0m5.418s user 0m10.990s sys 0m1.302s > time cat /tmp/list2 | fzf-head -fqwerty > /dev/null real 0m4.862s user 0m6.619s sys 0m0.982s
2015-04-17Improvements in performance and memory usageJunegunn Choi
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.
2015-04-16Add --no-hscroll option to disable horizontal scrollJunegunn Choi
Close #193
2015-03-29Implement --expect option to support simple key bindings (#163)Junegunn Choi
2015-03-22Code cleanupJunegunn Choi
2015-03-19Add support for ANSI color codesJunegunn Choi
2015-02-17Fix typo in codeJunegunn Choi