summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/divelist.c b/divelist.c
index 9fe3240d5..cccd3a0a6 100644
--- a/divelist.c
+++ b/divelist.c
@@ -1040,3 +1040,11 @@ void process_dives(bool is_imported, bool prefer_imported)
mark_divelist_changed(true);
}
}
+
+void set_dive_nr_for_current_dive()
+{
+ if (dive_table.nr == 1)
+ current_dive->number = 1;
+ else if (selected_dive == dive_table.nr - 1 && get_dive(dive_table.nr - 2)->number)
+ current_dive->number = get_dive(dive_table.nr - 2)->number + 1;
+}