From c13ea6b6522714382f22e5055ff54baa39833f70 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 18 Oct 2024 21:48:57 -0400 Subject: [PATCH] Fix clipboard duplication if persistdir = tmpdir --- src/cb/src/actions/status.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cb/src/actions/status.cpp b/src/cb/src/actions/status.cpp index ac5eba553..67af5bce7 100644 --- a/src/cb/src/actions/status.cpp +++ b/src/cb/src/actions/status.cpp @@ -24,6 +24,7 @@ std::vector clipboardsWithContent() { for (const auto& entry : fs::directory_iterator(global_path.persistent)) if (auto cb = Clipboard(entry.path().filename().string()); cb.holdsDataInCurrentEntry()) clipboards.emplace_back(cb); std::sort(clipboards.begin(), clipboards.end(), [](const auto& a, const auto& b) { return a.name() < b.name(); }); + clipboards.erase(std::unique(clipboards.begin(), clipboards.end(), [](const auto& a, const auto& b) { return a.name() == b.name(); }), clipboards.end()); return clipboards; }