m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-08 11:23:47 -05:00

Short-circuit ANSI processing if no ANSI codes are found

This commit is contained in:
Junegunn Choi
2017-08-17 19:11:56 +09:00
parent 644277faf1
commit 656963e018

View File

@@ -74,8 +74,11 @@ func extractColor(str string, state *ansiState, proc func(string, *ansiState) bo
for idx := 0; idx < len(str); {
idx += findAnsiStart(str[idx:])
// No sign of ANSI code
if idx == len(str) {
// No sign of ANSI code
if len(offsets) == 0 {
return str, nil, state
}
break
}