From 6030b355ff6a8ac152bddf7e61c35c70c85435d7 Mon Sep 17 00:00:00 2001 From: davidbmx Date: Tue, 10 Sep 2019 12:38:12 -0500 Subject: [PATCH] Remove num results when don't match find --- client/utils/codemirror-search.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/utils/codemirror-search.js b/client/utils/codemirror-search.js index 4a894320..6e904656 100644 --- a/client/utils/codemirror-search.js +++ b/client/utils/codemirror-search.js @@ -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);