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
This commit is contained in:
Scott Sumner 2019-08-19 13:34:10 -04:00 committed by Don HO
parent ab46fe0806
commit e102ecb919
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

View File

@ -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);