From 7af3c104d51f889ced48bc9f51e48bc0ee1876df Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sat, 23 Nov 2024 17:50:06 +0100 Subject: [PATCH] Fix copied paths repeated for "Copy Selected Pathname(s)" in Search results Fix: https://community.notepad-plus-plus.org/topic/26388/notepad-v8-7-2-release-candidate/11?_=1732379132698 Fixed by: https://github.com/notepad-plus-plus/notepad-plus-plus/commit/af2b90f0a586028afb3f26159cfaa4eaf250ed84#r149445528 --- PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 84246b11b057..ad75a4b9c2f8 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -719,14 +719,17 @@ vector Finder::getResultFilePaths(bool onlyInSelectedText) const if (line < len) found = true; // Found it } + if (found) { - wstring& path = (*_pMainFoundInfos)[line]._fullPath; // Get the path from the container - paths.push_back(path); + wstring& path = (*_pMainFoundInfos)[line]._fullPath; + if (std::find(paths.begin(), paths.end(), path) == paths.end()) + { + paths.push_back(path); + } } } - return paths; }