Skip to content

Commit

Permalink
Desktop: Fixes #3093: Prevent Goto Anything from freezing when inputt…
Browse files Browse the repository at this point in the history
…ing special characters
  • Loading branch information
laurent22 committed Apr 20, 2020
1 parent c65ee4a commit e7169cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ElectronClient/plugins/GotoAnything.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class Dialog extends React.PureComponent {
const mergedIndices = mergeOverlappingIntervals(indices, 3);
fragments = mergedIndices.map(f => body.slice(f[0], f[1])).join(' ... ');
// Add trailing ellipsis if the final fragment doesn't end where the note is ending
if (mergedIndices[mergedIndices.length - 1][1] !== body.length) fragments += ' ...';
if (mergedIndices.length && mergedIndices[mergedIndices.length - 1][1] !== body.length) fragments += ' ...';
}

results[i] = Object.assign({}, row, { path, fragments });
Expand Down

0 comments on commit e7169cc

Please sign in to comment.