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) { customizeOpenDialog(activeCM, template.find, function (query) {
this(query); this(query);
searchState = activeCM.state.search; searchState = activeCM.state.search;
if (editors.length === 1 || !searchState.query) { const searchOthers = editors.length > 1 && searchState.query;
return;
}
editors.forEach(cm => { editors.forEach(cm => {
if (cm !== activeCM) { if (cm !== activeCM) {
cm.execCommand('clearSearch'); cm.execCommand('clearSearch');
updateState(cm, searchState); if (searchOthers) {
updateState(cm, searchState);
}
} }
}); });
if (CodeMirror.cmpPos(searchState.posFrom, searchState.posTo) === 0) { if (searchOthers && CodeMirror.cmpPos(searchState.posFrom, searchState.posTo) === 0) {
findNext(activeCM); findNext(activeCM);
} }
}); });