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

chore: use strings.ReplaceAll (#3801)

This commit is contained in:
Zhizhen He
2024-05-18 16:06:33 +08:00
committed by GitHub
parent 0994d9c881
commit 01e7668915
6 changed files with 13 additions and 13 deletions

View File

@@ -554,7 +554,7 @@ func splitNth(str string) ([]Range, error) {
func delimiterRegexp(str string) Delimiter {
// Special handling of \t
str = strings.Replace(str, "\\t", "\t", -1)
str = strings.ReplaceAll(str, "\\t", "\t")
// 1. Pattern does not contain any special character
if regexp.QuoteMeta(str) == str {
@@ -1132,9 +1132,9 @@ Loop:
masked += strings.Repeat(" ", loc[1])
action = action[loc[1]:]
}
masked = strings.Replace(masked, "::", string([]rune{escapedColon, ':'}), -1)
masked = strings.Replace(masked, ",:", string([]rune{escapedComma, ':'}), -1)
masked = strings.Replace(masked, "+:", string([]rune{escapedPlus, ':'}), -1)
masked = strings.ReplaceAll(masked, "::", string([]rune{escapedColon, ':'}))
masked = strings.ReplaceAll(masked, ",:", string([]rune{escapedComma, ':'}))
masked = strings.ReplaceAll(masked, "+:", string([]rune{escapedPlus, ':'}))
return masked
}