From bfeed44372366ef670290f5dc27423f607edd9d2 Mon Sep 17 00:00:00 2001 From: mattpass Date: Tue, 23 Jun 2020 20:22:51 +0100 Subject: [PATCH] Clear selection by setting cursor if no results --- assets/js/icecoder.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/js/icecoder.js b/assets/js/icecoder.js index 51a167c..707888d 100644 --- a/assets/js/icecoder.js +++ b/assets/js/icecoder.js @@ -2683,6 +2683,9 @@ var ICEcoder = { this.content.contentWindow.document.getElementById('resultsBar').innerHTML = ""; this.content.contentWindow.document.getElementById('resultsBar').style.display = "none"; + // Clear our selection and so also the match highlights + thisCM.setCursor(thisCM.getCursor("anchor")); + return false; } } else { @@ -2724,6 +2727,9 @@ var ICEcoder = { results.innerHTML = "No results"; this.content.contentWindow.document.getElementById('resultsBar').innerHTML = ""; this.content.contentWindow.document.getElementById('resultsBar').style.display = "none"; + + // Clear our selection and so also the match highlights + thisCM.setCursor(thisCM.getCursor("anchor")); } } },