Skip to content

Commit

Permalink
[search ui] Allow /i after regexp input
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Jun 12, 2012
1 parent 3805278 commit 8de67d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/util/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
else if (confirm(shortText)) fs[0]();
}
function parseQuery(query) {
var isRE = query.match(/^\/(.*)\/$/);
return isRE ? new RegExp(isRE[1]) : query;
var isRE = query.match(/^\/(.*)\/([a-z]*)$/);
return isRE ? new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i") : query;
}
var queryDialog =
'Search: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp search)</span>';
Expand Down

0 comments on commit 8de67d2

Please sign in to comment.