Skip to content

Commit

Permalink
Fix clipboard duplication if persistdir = tmpdir
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Oct 19, 2024
1 parent c11f2ba commit c13ea6b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/cb/src/actions/status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ std::vector<Clipboard> 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;
}

Expand Down

0 comments on commit c13ea6b

Please sign in to comment.