mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
@@ -337,7 +337,7 @@ struct TagsEdit::Impl
|
|||||||
assert(i < tags.size());
|
assert(i < tags.size());
|
||||||
auto occurrencesOfCurrentText =
|
auto occurrencesOfCurrentText =
|
||||||
std::count_if(tags.cbegin(), tags.cend(), [this](const auto& tag) { return tag.text == currentText(); });
|
std::count_if(tags.cbegin(), tags.cend(), [this](const auto& tag) { return tag.text == currentText(); });
|
||||||
if (currentText().isEmpty() || occurrencesOfCurrentText > 1) {
|
if (tags.size() > 1 && (currentText().isEmpty() || occurrencesOfCurrentText > 1)) {
|
||||||
tags.erase(std::next(tags.begin(), std::ptrdiff_t(editing_index)));
|
tags.erase(std::next(tags.begin(), std::ptrdiff_t(editing_index)));
|
||||||
if (editing_index <= i) { // Do we shift positions after `i`?
|
if (editing_index <= i) { // Do we shift positions after `i`?
|
||||||
--i;
|
--i;
|
||||||
|
|||||||
Reference in New Issue
Block a user