mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-25 12:17:20 +02:00
CmdCalendar: Respect calendar.monthsperline alongside monthsperline
This commit is contained in:
parent
898a6d200d
commit
c22b233300
1 changed files with 8 additions and 1 deletions
|
@ -64,7 +64,14 @@ int CmdCalendar::execute (std::string& output)
|
|||
// Each month requires 28 text columns width. See how many will actually
|
||||
// fit. But if a preference is specified, and it fits, use it.
|
||||
auto width = Context::getContext ().getWidth ();
|
||||
auto preferredMonthsPerLine = config.getInteger ("monthsperline");
|
||||
int preferredMonthsPerLine;
|
||||
|
||||
if (config.has ("calendar.monthsperline"))
|
||||
preferredMonthsPerLine = config.getInteger ("calendar.monthsperline");
|
||||
else
|
||||
// Legacy configuration variable value
|
||||
preferredMonthsPerLine = config.getInteger ("monthsperline");
|
||||
|
||||
auto monthsThatFit = width / 26;
|
||||
|
||||
auto monthsPerLine = monthsThatFit;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue