aboutsummaryrefslogtreecommitdiff
path: root/ttt.jai
diff options
context:
space:
mode:
Diffstat (limited to 'ttt.jai')
-rw-r--r--ttt.jai11
1 files changed, 4 insertions, 7 deletions
diff --git a/ttt.jai b/ttt.jai
index 5c8e950..3822d72 100644
--- a/ttt.jai
+++ b/ttt.jai
@@ -241,7 +241,7 @@ is_empty_string :: (str: string) -> bool {
// Prints, on row y and column x, the time using 5 characters centered on space.
// Returns the result of a call to mvprintw.
-mvprintw_time :: (y: s32, x: s32, time: s64, space: s32) -> int { // BUG Setting a timer to 99.9y shows 100y.
+mvprintw_time :: (y: s32, x: s32, time: s64, space: s32) -> int {
TIME_CHARS :: 5;
assert(space >= TIME_CHARS);
@@ -730,11 +730,8 @@ import_from_csv :: (db: *Database, path: string) -> bool {
truncate_string(xx task.name, name_length);
advance(*csv_values);
- for csv_values {
- parsed_value := string_to_int(it);
- task.times[it_index] = parsed_value;
- db.total_times[it_index] = add_int64(db.total_times[it_index], parsed_value);
- }
+ for csv_values
+ task.times[it_index] = string_to_int(it);
add_task(db, *task);
// TODO Check this old code and remove it if not necessary.
@@ -746,7 +743,7 @@ import_from_csv :: (db: *Database, path: string) -> bool {
}
// Adjust selected task.
- if (db.selected_idx < 0) db.selected_idx = 0;
+ if (db.selected_idx < 0 && db.tasks.count > 0) db.selected_idx = 0;
return true;
}