mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-01 12:42:01 -07:00
Fix index out of bounds error during Transform
This commit is contained in:
@@ -186,7 +186,13 @@ func Transform(tokens []Token, withNth []Range) *Transformed {
|
||||
}
|
||||
}
|
||||
whole += part
|
||||
transTokens[idx] = Token{&part, tokens[minIdx].prefixLength}
|
||||
var prefixLength int
|
||||
if minIdx < numTokens {
|
||||
prefixLength = tokens[minIdx].prefixLength
|
||||
} else {
|
||||
prefixLength = 0
|
||||
}
|
||||
transTokens[idx] = Token{&part, prefixLength}
|
||||
}
|
||||
return &Transformed{
|
||||
whole: &whole,
|
||||
|
Reference in New Issue
Block a user