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);