mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-01 04:32:05 -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:
@@ -52,6 +52,12 @@ class TestFilter < TestBase
|
||||
`find . -print0 | #{FZF} --read0 -e -f "^#{lines.last}$"`.chomp
|
||||
end
|
||||
|
||||
def test_nth_suffix_match
|
||||
assert_equal \
|
||||
'foo,bar,baz',
|
||||
`echo foo,bar,baz | #{FZF} -d, -f'bar$' -n2`.chomp
|
||||
end
|
||||
|
||||
def test_with_nth_basic
|
||||
writelines(['hello world ', 'byebye'])
|
||||
assert_equal \
|
||||
|
Reference in New Issue
Block a user