diff --git a/services/web/frontend/js/features/symbol-palette/components/symbol-palette-content.js b/services/web/frontend/js/features/symbol-palette/components/symbol-palette-content.js index 2e496863d7..f22759c69a 100644 --- a/services/web/frontend/js/features/symbol-palette/components/symbol-palette-content.js +++ b/services/web/frontend/js/features/symbol-palette/components/symbol-palette-content.js @@ -32,10 +32,16 @@ export default function SymbolPaletteContent({ handleSelect }) { return null } - return matchSorter(symbols, input, { - keys: ['command', 'description'], - threshold: matchSorter.rankings.CONTAINS, - }) + const words = input.trim().split(/\W+/) + + return words.reduceRight( + (symbols, word) => + matchSorter(symbols, word, { + keys: ['command', 'description'], + threshold: matchSorter.rankings.CONTAINS, + }), + symbols + ) }, [input]) const inputRef = useRef(null)