mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-10-26 11:08:40 +03:00
Merge pull request #913 from savetheclocktower/fix-command-palette-match-highlighting
[command-palette] Guard against failure to highlight a match
This commit is contained in:
commit
732d1d40a6
@ -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;
|
||||
const 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