Skip to content

Commit

Permalink
feat(core): better space display style
Browse files Browse the repository at this point in the history
  • Loading branch information
NWYLZW committed Sep 9, 2023
1 parent 7dfec37 commit 3d828bb
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion core/src/components/base/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export const List = forwardRefWithStatic<{
})}
onClick={() => setEnableWordMatch(e => !e)}
/>
<code>{keyword}</code>
<code>{keyword.replace(/ /g, '␣')}</code>
</>
})
useEffect(() => {
Expand Down Expand Up @@ -382,18 +382,34 @@ export const List = forwardRefWithStatic<{
// ⌘ % : switch fuzzy mode |
// ⌫ : delete last char |
if (keyword.length > 0) {
// ⎋
if (e.key === 'Escape' && withoutAll) {
e.preventDefault()
e.stopPropagation()
setKeyword('')
return
}
// ⌫
if (e.key === 'Backspace' && withoutAll) {
e.preventDefault()
e.stopPropagation()
setKeyword(keyword => keyword.slice(0, -1))
return
}
// ⌥ c
if (e.key === 'ç') {
e.preventDefault()
e.stopPropagation()
setEnableUpperKeywordsIgnore(e => !e)
return
}
// ⌥ w
if (e.key === '∑') {
e.preventDefault()
e.stopPropagation()
setEnableWordMatch(e => !e)
return
}
}

// ? : get help
Expand Down

0 comments on commit 3d828bb

Please sign in to comment.