mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
[command-palette] Guard against failure to highlight a match
This commit is contained in:
parent
d1bb4c24a2
commit
2c5be1eda9
@ -135,8 +135,9 @@ export default class CommandPaletteView {
|
||||
highlightMatchesInElement (text, query, el) {
|
||||
const matches = atom.ui.fuzzyMatcher.match(text, query, {recordMatchIndexes: true})
|
||||
let matchedChars = []
|
||||
let lastIndex = 0
|
||||
matches.matchIndexes.forEach(matchIndex => {
|
||||
let lastIndex = 0;
|
||||
let matchIndexes = matches ? (matches.matchIndexes ?? []) : []
|
||||
matchIndexes.forEach(matchIndex => {
|
||||
const unmatched = text.substring(lastIndex, matchIndex)
|
||||
if (unmatched) {
|
||||
if (matchedChars.length > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user