summaryrefslogtreecommitdiff
path: root/src/ansi_test.go
AgeCommit message (Collapse)Author
2025-06-25Support full-line background color in the list sectionJunegunn Choi
Close #4432
2025-01-10Trim unsupported OSC sequences (#4169)Junegunn Choi
Fix #4169
2025-01-10Add a test case for the mixed delimiter ANSI sequence (#4169)Junegunn Choi
2025-01-10Support ANSI sequences with mixed ; and : delimiters (#4169)Junegunn Choi
`make bench` shows no loss of performance.
2024-05-18chore: use strings.ReplaceAll (#3801)Zhizhen He
2023-12-25Fix handling of empty ANSI color sequenceJunegunn Choi
Fix #3320
2022-08-13Update ANSI test casesJunegunn Choi
2022-08-13Support colon delimiter in ANSI escape sequencesJunegunn Choi
# Both should work printf "\e[38;5;208mOption 1\e[m\nOption 2" | fzf --ansi printf "\e[38:5:208mOption 1\e[m\nOption 2" | fzf --ansi This change makes ANSI parsing slightly slower. cpu: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz Before: BenchmarkNextAnsiEscapeSequence-12 992.22 MB/s BenchmarkExtractColor-12 174.35 MB/s After: BenchmarkNextAnsiEscapeSequence-12 925.05 MB/s BenchmarkExtractColor-12 163.33 MB/s Fix #2913
2022-08-12Reformat comments adhere to gofmtJunegunn Choi
2021-09-28fix: replace broken links with archived onesHiroki Konishi
2021-09-28fix: spelling `Refence` -> `Reference`Hiroki Konishi
2021-09-24[tests] Change tests to output to stdout only with verbose flagVlastimil Ovčáčík
This hides stdout output unless "go test -v" was run.
2021-03-11Speed up ANSI code processing (#2368)Charlie Vieth
This commit speeds up the parsing/processing of ANSI escape codes by roughly 7.5x. The speedup is mostly accomplished by replacing the regex with dedicated parsing logic (nextAnsiEscapeSequence()) and reducing the number of allocations in extractColor(). #### Benchmarks ``` name old time/op new time/op delta ExtractColor-16 4.89µs ± 5% 0.64µs ± 2% -86.87% (p=0.000 n=9+9) name old speed new speed delta ExtractColor-16 25.6MB/s ± 5% 194.6MB/s ± 2% +661.43% (p=0.000 n=9+9) name old alloc/op new alloc/op delta ExtractColor-16 1.37kB ± 0% 0.31kB ± 0% -77.31% (p=0.000 n=10+10) name old allocs/op new allocs/op delta ExtractColor-16 48.0 ± 0% 4.0 ± 0% -91.67% (p=0.000 n=10+10) ```
2020-11-25Fix unit testsJunegunn Choi
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
2016-11-14Update ANSI processor to handle more VT-100 escape sequencesJunegunn Choi
The updated regular expression should include not all but most of the frequently used ANSI sequences. Close #735.
2016-11-07Prepare for termbox/windows buildJunegunn Choi
`TAGS=termbox make` (or `go build -tags termbox`)
2016-09-29Fix failing unit tests on ANSI attributesJunegunn 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-06-14Do not process ANSI codes in --preview output at onceJunegunn Choi
Close #598
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-07-22Fix ANSI processor to handle multi-line regionsJunegunn Choi
2015-03-27Fix #162 - Ignore \e[KJunegunn Choi
2015-03-23Fix #155 - Empty ANSI color code to reset color stateJunegunn Choi
2015-03-22Code cleanupJunegunn Choi
2015-03-19Add support for ANSI color codesJunegunn Choi