Skip to content

Commit de0d16b

Browse files
committed
make resting periods indented for visibility in summary itineraries
1 parent eefeb04 commit de0d16b

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/formatter/formatter_core.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,16 +289,21 @@ std::string generate_full_text_report(
289289

290290
size_t max_activity_width = 0;
291291
for (const auto& item : itinerary.items) {
292-
max_activity_width = std::max(max_activity_width, item.activity.length());
292+
size_t len = item.activity.length();
293+
if (item.activity == "Resting") len += 2;
294+
max_activity_width = std::max(max_activity_width, len);
293295
}
294296

295297
std::string tz_string = std::string("UTC") + (itinerary.tz_offset >= 0 ? "+" : "") + std::to_string(itinerary.tz_offset);
296298
f << "\nSchedule for " << name << " (" << tz_string << "):\n";
297299

298300
for (const auto& item : itinerary.items) {
299301
double dur = item.end_local.diff_seconds(item.start_local);
302+
std::string display_act = item.activity;
303+
if (display_act == "Resting") display_act = " " + display_act;
304+
300305
f << " " << item.start_local.to_string() << " to " << item.end_local.time_string()
301-
<< " " << std::left << std::setw(max_activity_width) << item.activity
306+
<< " " << std::left << std::setw(max_activity_width) << display_act
302307
<< " (" << DateTime::format_duration((long long)dur) << ")\n";
303308
}
304309
}

0 commit comments

Comments
 (0)