clear previous search highlight from scrollbar in all sections

This commit is contained in:
tophf 2017-12-05 05:39:33 +03:00
parent cb7f1de348
commit 8e992299c6

View File

@ -335,16 +335,16 @@ onDOMready().then(() => {
customizeOpenDialog(activeCM, template.find, function (query) {
this(query);
searchState = activeCM.state.search;
if (editors.length === 1 || !searchState.query) {
return;
}
const searchOthers = editors.length > 1 && searchState.query;
editors.forEach(cm => {
if (cm !== activeCM) {
cm.execCommand('clearSearch');
if (searchOthers) {
updateState(cm, searchState);
}
}
});
if (CodeMirror.cmpPos(searchState.posFrom, searchState.posTo) === 0) {
if (searchOthers && CodeMirror.cmpPos(searchState.posFrom, searchState.posTo) === 0) {
findNext(activeCM);
}
});