Skip to content

Commit d5d78d9

Browse files
committed
reverse predict order
1 parent 6237692 commit d5d78d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/textual/fuzzy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def score(search: _Search) -> float:
134134
# Boost to favor less groups
135135
offset_count = len(search.offsets)
136136
normalized_groups = (offset_count - (search.groups - 1)) / offset_count
137-
score *= 1 + (normalized_groups**2)
137+
score *= 1 + (normalized_groups * normalized_groups)
138138
return score
139139

140140
stack: list[_Search] = [_Search()]
@@ -156,8 +156,8 @@ def score(search: _Search) -> float:
156156
yield score(advance_branch), advance_branch.offsets
157157
push(branch)
158158
else:
159-
push(advance_branch)
160159
push(branch)
160+
push(advance_branch)
161161

162162

163163
@rich.repr.auto

0 commit comments

Comments
 (0)