Skip to content

Commit 9e3681c

Browse files
committed
helper details
1 parent 9a98be4 commit 9e3681c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

visidata/features/cmdpalette.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ def _format_match(s, positions):
1919
return "".join(out)
2020

2121

22-
def _fuzzy_match(description, row, words):
22+
def _fuzzymatch(longname, description, words):
2323
longname_score, desc_score = 0, 0
2424
positions_name = set()
2525
positions_desc = set()
2626
for word in words:
27-
result_name = vd.fuzzymatch(row.longname, word)
27+
result_name = vd.fuzzymatch(longname, word)
2828
result_desc = vd.fuzzymatch(description.lower(), word)
29-
# if a word matches neither, we can skip the row
29+
# if a word matches neither, we can skip the rest
3030
if result_name.start == -1 and result_desc.start == -1:
3131
longname_score, desc_score = 0, 0
3232
break
@@ -57,7 +57,7 @@ def cmdpal_matcher(value):
5757
words = value.lower().split()
5858
for row in this_sheets_help.rows:
5959
description = this_sheets_help.cmddict[(row.sheet, row.longname)].helpstr
60-
score, positions_desc, positions_name = _fuzzy_match(description, row, words)
60+
score, positions_desc, positions_name = _fuzzymatch(row.longname, description, words)
6161
if score > 0:
6262
keystrokes = this_sheets_help.revbinds.get(row.longname, [None])[0]
6363
formatted_name = f'[:onclick {row.longname}]{_format_match(row.longname, positions_name)}[/]'

0 commit comments

Comments
 (0)