Skip to content

Commit

Permalink
Fix the 2nd replace in cloned document for Replace in Opened Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alankilborn authored and donho committed Dec 22, 2023
1 parent 7419770 commit 08222a8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion PowerEditor/src/Notepad_plus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,15 @@ bool Notepad_plus::replaceInOpenedFiles()
{
for (size_t i = 0, len = _subDocTab.nbItem(); i < len; ++i)
{
pBuf = MainFileManager.getBufferByID(_subDocTab.getBufferByIndex(i));
BufferID bufId = _subDocTab.getBufferByIndex(i);

if (_mainDocTab.getIndexByBuffer(bufId) != -1)
{
// cloned doc, replacements already done in main doc
continue;
}

pBuf = MainFileManager.getBufferByID(bufId);
if (pBuf->isReadOnly())
continue;
_invisibleEditView.execute(SCI_SETDOCPOINTER, 0, pBuf->getDocument());
Expand Down

0 comments on commit 08222a8

Please sign in to comment.