No selectNext if selected already on findOnInput

This commit is contained in:
Matt Pass
2022-05-21 13:15:52 +01:00
committed by GitHub
parent 509b5b8fb8
commit e21c16e1ee

View File

@@ -2899,10 +2899,14 @@ var ICEcoder = {
},
findOnInput: function() {
let thisCM, selectNext;
// Realtime finding - only action for finding in current doc
if ("" !== get('find').value && t['this document'] === document.findAndReplace.target.value) {
// Considers selecting next on value input, according to user setting
ICEcoder.findReplace(get('find').value, true === ICEcoder.selectNextOnFindInput, false, false);
// Get CM pane
thisCM = this.getThisCM();
// Consider selecting next on value input, according to not having result selected already and user setting
selectNext = thisCM.getSelection() !== get('find').value && true === ICEcoder.selectNextOnFindInput;
ICEcoder.findReplace(get('find').value, selectNext, false, false);
get("find").focus();
// Reset results display
} else {