Remove num results when don't match find
This commit is contained in:
parent
22f958e50a
commit
6030b355ff
1 changed files with 4 additions and 1 deletions
|
@ -356,7 +356,10 @@ export default function(CodeMirror) {
|
|||
var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);
|
||||
if (!cursor.find(rev)) {
|
||||
cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0));
|
||||
if (!cursor.find(rev)) return;
|
||||
if (!cursor.find(rev)) {
|
||||
cm.display.wrapper.querySelector('.CodeMirror-search-results').innerText = '';
|
||||
return;
|
||||
}
|
||||
}
|
||||
cm.setSelection(cursor.from(), cursor.to());
|
||||
cm.scrollIntoView({from: cursor.from(), to: cursor.to()}, 60);
|
||||
|
|
Loading…
Reference in a new issue