summaryrefslogtreecommitdiff
path: root/public/vendor/codemirror/addon/search/search.js
diff options
context:
space:
mode:
authorWu Cheng-Han2016-10-10 21:15:29 +0800
committerWu Cheng-Han2016-10-10 21:15:29 +0800
commit795ea21191486a80437d7c535defc503962c5968 (patch)
tree434a65ec986264b2abdec29b8f6a837ca536d2dd /public/vendor/codemirror/addon/search/search.js
parentfb5d7e43592c1a14831067e28def9c4b9e2a97ca (diff)
Update CodeMirror to 5.19.0 and rename jade to pug
Diffstat (limited to 'public/vendor/codemirror/addon/search/search.js')
-rw-r--r--public/vendor/codemirror/addon/search/search.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/public/vendor/codemirror/addon/search/search.js b/public/vendor/codemirror/addon/search/search.js
index c005866f..753b1afe 100644
--- a/public/vendor/codemirror/addon/search/search.js
+++ b/public/vendor/codemirror/addon/search/search.js
@@ -136,8 +136,11 @@
})
};
persistentDialog(cm, queryDialog, q, searchNext, function(event, query) {
- var cmd = CodeMirror.keyMap[cm.getOption("keyMap")][CodeMirror.keyName(event)];
- if (cmd == "findNext" || cmd == "findPrev") {
+ var keyName = CodeMirror.keyName(event)
+ var cmd = CodeMirror.keyMap[cm.getOption("keyMap")][keyName]
+ if (!cmd) cmd = cm.getOption('extraKeys')[keyName]
+ if (cmd == "findNext" || cmd == "findPrev" ||
+ cmd == "findPersistentNext" || cmd == "findPersistentPrev") {
CodeMirror.e_stop(event);
startSearch(cm, getSearchState(cm), query);
cm.execCommand(cmd);
@@ -146,7 +149,7 @@
searchNext(query, event);
}
});
- if (immediate) {
+ if (immediate && q) {
startSearch(cm, state, q);
findNext(cm, rev);
}