Added support for searching by regular expression

This commit is contained in:
Alex Ross
2018-09-07 09:47:15 -07:00
parent 3a310f1597
commit 88205511e6
5 changed files with 35 additions and 20 deletions
+1
View File
@@ -16,6 +16,7 @@
<p>
<label>Find next <input id="find-next"/></label>
<label>Find previous <input id="find-previous"/></label>
<label>Use regex<input type="checkbox" id="regex"/></label>
</p>
</div>
<div>
+2 -2
View File
@@ -83,13 +83,13 @@ function createTerminal() {
addDomListener(actionElements.findNext, 'keypress', function (e) {
if (e.key === "Enter") {
e.preventDefault();
term.findNext(actionElements.findNext.value);
term.findNext(actionElements.findNext.value, document.getElementById('regex').checked);
}
});
addDomListener(actionElements.findPrevious, 'keypress', function (e) {
if (e.key === "Enter") {
e.preventDefault();
term.findPrevious(actionElements.findPrevious.value);
term.findPrevious(actionElements.findPrevious.value, document.getElementById('regex').checked);
}
});