From e102ecb919fd3f5ed524d136c104f9208cfedec6 Mon Sep 17 00:00:00 2001 From: Scott Sumner <30118311+sasumner@users.noreply.github.com> Date: Mon, 19 Aug 2019 13:34:10 -0400 Subject: [PATCH] Fix find 2 occurrences in original/clonned doccuments issue Fix for Find-All-in-All-Opened-Documents searching a cloned document two times, and reporting same results two times. Fix #6704, close #6705 --- PowerEditor/src/Notepad_plus.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index e23dd26c1..b1b9e5208 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -1802,6 +1802,10 @@ bool Notepad_plus::findInOpenedFiles() for (size_t i = 0, len2 = _subDocTab.nbItem(); i < len2 ; ++i) { pBuf = MainFileManager.getBufferByID(_subDocTab.getBufferByIndex(i)); + if (_mainDocTab.getIndexByBuffer(pBuf) != -1) + { + continue; // clone was already searched in main; skip re-searching in sub + } _invisibleEditView.execute(SCI_SETDOCPOINTER, 0, pBuf->getDocument()); auto cp = _invisibleEditView.execute(SCI_GETCODEPAGE); _invisibleEditView.execute(SCI_SETCODEPAGE, pBuf->getUnicodeMode() == uni8Bit ? cp : SC_CP_UTF8);