summaryrefslogtreecommitdiff
path: root/src/util/chars.go
AgeCommit message (Collapse)Author
2025-06-24with-nth: Do not trim trailing whitespaces with background colorsJunegunn Choi
Example: echo -en ' \e[48;5;232mhello\e[48;5;147m ' | fzf --ansi --with-nth 1
2025-03-16Fix wrapping of the list sectionJunegunn Choi
# The first line of the second chunk would prematurely wrap printf '%0500s\n\n%0500s' 0 0 | fzf --wrap --read0
2025-02-26Trim trailing whitespaces after processing ANSI sequencesJunegunn Choi
Close #4282
2025-02-12Make --accept-nth and --with-nth support templatesJunegunn Choi
2025-02-09Add --accept-nth option to transform the outputJunegunn Choi
This option can be used to replace a sed or awk in the post-processing step. ps -ef | fzf --multi --header-lines 1 | awk '{print $2}' ps -ef | fzf --multi --header-lines 1 --accept-nth 2 This may not be a very "Unix-y" thing to do, so I've always felt that fzf shouldn't have such an option, but I've finally changed my mind because: * fzf can be configured with a custom delimiter that is a fixed string or a regular expression. * In such cases, you'd need to repeat the delimiter again in the post-processing step. * Also, tools like awk or sed may interpret a regular expression differently, causing mismatches. You can still use sed, cut, or awk if you prefer. Close #3987 Close #1323
2024-11-12Fix incorrect overflow detection when --wrap is setJunegunn Choi
Fix #4083
2024-06-25Add --wrap option and 'toggle-wrap' action (#3887)Junegunn Choi
* `--wrap` * `--wrap-sign` * `toggle-wrap` Close #3619 Close #2236 Close #577 Close #461
2024-05-27Different marker for the first and last line of multi-line entriesJunegunn Choi
Can be configured via `--marker-multi-line`
2024-05-20Implement multi-line display of multi-line itemsJunegunn Choi
2024-04-14Improve search performance by limiting the search scopeJunegunn Choi
Find the last occurrence of the last character in the pattern and perform the search algorithm only up to that point. The effectiveness of this mechanism depends a lot on the shape of the input and the pattern.
2024-04-02Further performance improvements by removing unnecessary copiesJunegunn Choi
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-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-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
2017-08-26Minor refactoringsJunegunn Choi
2017-08-01Modify loop conditions in checkAscii functionJunegunn 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
2016-09-29Use unicode.IsSpace to cover more whitespace charactersJunegunn 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.