clear previous search highlight from scrollbar in all sections
This commit is contained in:
parent
cb7f1de348
commit
8e992299c6
|
@ -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');
|
||||||
|
if (searchOthers) {
|
||||||
updateState(cm, searchState);
|
updateState(cm, searchState);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
if (CodeMirror.cmpPos(searchState.posFrom, searchState.posTo) === 0) {
|
if (searchOthers && CodeMirror.cmpPos(searchState.posFrom, searchState.posTo) === 0) {
|
||||||
findNext(activeCM);
|
findNext(activeCM);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user