summaryrefslogtreecommitdiffstats
path: root/info.c
diff options
context:
space:
mode:
Diffstat (limited to 'info.c')
-rw-r--r--info.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/info.c b/info.c
index 724c1dcfd..c5f918e9d 100644
--- a/info.c
+++ b/info.c
@@ -609,6 +609,13 @@ static void save_dive_info_changes(struct dive *dive, struct dive *master, struc
if (tags_shown && dive->dive_tags != master->dive_tags) {
changed = 1;
dive->dive_tags = master->dive_tags;
+ /* if a dive is selected and we aren't showing invalid dives and it is
+ * now marked as invalid we need to deselect it to keep the selection
+ * state consistent */
+ if (!prefs.display_invalid_dives && dive->selected && dive->dive_tags & DTAG_INVALID) {
+ dive->selected = 0;
+ amount_selected--;
+ }
}
if (changed) {
mark_divelist_changed(TRUE);