mirror of
https://github.com/junegunn/fzf.git
synced 2026-10-13 00:20:20 +08:00
Don't trim last field when delimiter is regex (#4266)
This commit is contained in:
1 parent
a24d274a3c
commit
77568e114f
2 files changed
+12
-1
No files matched your search
+3
-1
@@ -225,7 +225,9 @@ func StripLastDelimiter(str string, delimiter Delimiter) string {
|
||||
locs := delimiter.regex.FindAllStringIndex(str, -1)
|
||||
if len(locs) > 0 {
|
||||
lastLoc := locs[len(locs)-1]
|
||||
str = str[:lastLoc[0]]
|
||||
if lastLoc[1] == len(str) {
|
||||
str = str[:lastLoc[0]]
|
||||
}
|
||||
}
|
||||
}
|
||||
return strings.TrimRightFunc(str, unicode.IsSpace)
|
||||
|
||||
Reference in new issue
Block a user