Skip to content

Commit 6030b35

Browse files
committed
Remove num results when don't match find
1 parent 22f958e commit 6030b35

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

client/utils/codemirror-search.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,10 @@ export default function(CodeMirror) {
356356
var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);
357357
if (!cursor.find(rev)) {
358358
cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0));
359-
if (!cursor.find(rev)) return;
359+
if (!cursor.find(rev)) {
360+
cm.display.wrapper.querySelector('.CodeMirror-search-results').innerText = '';
361+
return;
362+
}
360363
}
361364
cm.setSelection(cursor.from(), cursor.to());
362365
cm.scrollIntoView({from: cursor.from(), to: cursor.to()}, 60);

0 commit comments

Comments
 (0)