mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-17 21:43:50 -07:00
Allow suffix match on --nth with custom --delimiter
When --nth is used with a custom --delimiter, the last delimiter was included in the search scope, forcing you to write the delimiter in a suffix-match query. This commit removes the last delimiter from the search scope. # No need to write 'bar,$' echo foo,bar,baz | fzf --delimiter , --nth 2 --filter 'bar$' This can be seen as a breaking change, but I'm gonna say it's a bug fix. Fix #3983
This commit is contained in:
@@ -78,6 +78,11 @@ type Delimiter struct {
|
||||
str *string
|
||||
}
|
||||
|
||||
// IsAwk returns true if the delimiter is an AWK-style delimiter
|
||||
func (d Delimiter) IsAwk() bool {
|
||||
return d.regex == nil && d.str == nil
|
||||
}
|
||||
|
||||
// String returns the string representation of a Delimiter.
|
||||
func (d Delimiter) String() string {
|
||||
return fmt.Sprintf("Delimiter{regex: %v, str: &%q}", d.regex, *d.str)
|
||||
|
Reference in New Issue
Block a user