mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-01-09 09:50:26 +00:00
parent
3da63f394d
commit
1bebd6f4f5
@ -1,6 +1,10 @@
|
|||||||
CHANGELOG
|
CHANGELOG
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
0.35.1
|
||||||
|
------
|
||||||
|
- Fixed a bug where fzf with `--tiebreak=chunk` crashes on inverse match query
|
||||||
|
|
||||||
0.35.0
|
0.35.0
|
||||||
------
|
------
|
||||||
- Added `start` event that is triggered only once when fzf finder starts.
|
- Added `start` event that is triggered only once when fzf finder starts.
|
||||||
|
@ -50,20 +50,21 @@ func buildResult(item *Item, offsets []Offset, score int) Result {
|
|||||||
// Higher is better
|
// Higher is better
|
||||||
val = math.MaxUint16 - util.AsUint16(score)
|
val = math.MaxUint16 - util.AsUint16(score)
|
||||||
case byChunk:
|
case byChunk:
|
||||||
b := minBegin
|
if validOffsetFound {
|
||||||
e := maxEnd
|
b := minBegin
|
||||||
l := item.text.Length()
|
e := maxEnd
|
||||||
for ; b >= 1; b-- {
|
for ; b >= 1; b-- {
|
||||||
if unicode.IsSpace(item.text.Get(b - 1)) {
|
if unicode.IsSpace(item.text.Get(b - 1)) {
|
||||||
break
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
for ; e < numChars; e++ {
|
||||||
for ; e < l; e++ {
|
if unicode.IsSpace(item.text.Get(e)) {
|
||||||
if unicode.IsSpace(item.text.Get(e)) {
|
break
|
||||||
break
|
}
|
||||||
}
|
}
|
||||||
|
val = util.AsUint16(e - b)
|
||||||
}
|
}
|
||||||
val = util.AsUint16(e - b)
|
|
||||||
case byLength:
|
case byLength:
|
||||||
val = item.TrimLength()
|
val = item.TrimLength()
|
||||||
case byBegin, byEnd:
|
case byBegin, byEnd:
|
||||||
|
@ -779,6 +779,10 @@ class TestGoFZF < TestBase
|
|||||||
'2 foobar baz',
|
'2 foobar baz',
|
||||||
'3 foo barbaz'
|
'3 foo barbaz'
|
||||||
], `#{FZF} -fba --tiebreak=chunk < #{tempname}`.lines(chomp: true)
|
], `#{FZF} -fba --tiebreak=chunk < #{tempname}`.lines(chomp: true)
|
||||||
|
|
||||||
|
assert_equal [
|
||||||
|
'3 foo barbaz'
|
||||||
|
], `#{FZF} -f'!foobar' --tiebreak=chunk < #{tempname}`.lines(chomp: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_invalid_cache
|
def test_invalid_cache
|
||||||
|
Loading…
Reference in New Issue
Block a user