Skip to content

Commit

Permalink
Fix infinite loop in backwards search (fixes #25).
Browse files Browse the repository at this point in the history
  • Loading branch information
71 committed Nov 20, 2019
1 parent ec4a799 commit f3e48fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ function registerNextCommand(command: Command, backward: boolean, replace: boole
if (regexStr === undefined || regexStr.length === 0)
return

const regex = new RegExp(regexStr[0])
const regex = new RegExp(regexStr[0], 'g')
const next = backward
? searchBackward(editor.document, editor.selection.anchor, regex, true)
: search(editor.document, editor.selection.active, regex, true)
Expand Down

0 comments on commit f3e48fa

Please sign in to comment.