Skip to content
Snippets Groups Projects
Commit 7eb9ee93 authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

[searchcursor addon] Refuse to search for queries that match everything

It doesn't do anything useful, and makes replace-all loop
forever.

Closes #2259
parent 1221eef5
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,10 @@
pos = pos ? doc.clipPos(pos) : Pos(0, 0);
this.pos = {from: pos, to: pos};
// Prevent nonsensical behavior from queries that match everything.
if (typeof query == "string" ? query == "" : query.test(""))
query = /x^/;
// The matches method is filled in based on the type of query.
// It takes a position and a direction, and returns an object
// describing the next occurrence of the query, or null if no
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment