Skip to content

Commit 6c76cdc

Browse files
committed
Fix showing all icons
[why] The search term ' ' to show all icons does not work anymore after the last commit 71dfe12 cheatsheet: Do not remove dashes from index The reason is that before we split the names into terms, like `nf-pl-left_hard_divider` has been split into `nf`, `pl`, `left`, `hard`, and `divider`. But that made it impossibe to search for (only) `pl-` to show all powerline icons. That commit changed the tokenization such that we get instead `nf-pl-left`, `hard`, and `divider`. Before we searched to find all icons for `nf` as exact hit, has that was always part of any icon. But that is not the case anymore. Now we need to search for `nf-` and that as prefix hit. [note] From the above it seems impossible to search for `left`, as that is part of the new first token, but at its end. But that is not a problem because we do not only index the tag, but also the name, which is `left_hard_divider` -> `left`, `hard`, `divider`. Signed-off-by: Fini Jastrow <[email protected]>
1 parent 71dfe12 commit 6c76cdc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cheat-sheet.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ document.addEventListener('DOMContentLoaded', function () {
156156
emptyResultsMessage = "Enter (part) of a word to search for or paste the icon or enter space / blank (' ') to show all icons"
157157
} else {
158158
if (searchTerm === " ") {
159-
prefixSearchEnabled = false;
160-
searchTerm = "nf";
159+
searchTerm = "nf-";
161160
}
162161
}
163162

0 commit comments

Comments
 (0)