aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/calcurse.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/calcurse.c b/src/calcurse.c
index 1f0696d..3d8905f 100644
--- a/src/calcurse.c
+++ b/src/calcurse.c
@@ -49,11 +49,12 @@ int count, reg;
*/
static void do_storage(int day_changed)
{
+ int pre_sel;
/*
* Save the selected item before rebuilding the day vector -
- * unless already set.
+ * unless a preselection is already set.
*/
- if (!day_check_sel_data())
+ if (!(pre_sel = day_check_sel_data()))
day_set_sel_data(ui_day_get_sel());
if (!day_changed)
@@ -64,7 +65,7 @@ static void do_storage(int day_changed)
/* The APP listbox. */
ui_day_load_items();
- if (day_changed)
+ if (day_changed && !pre_sel)
ui_day_sel_reset();
else
ui_day_find_sel();