Files
calcurse-edge/src/calendar.c
Lukas Fleischer 7a230fa76a src/calendar.c: Fix range check in calendar_move()
We added count prefix support to motion commands in commit
59e006e56d but obviously forgot to check
whether the range checks in calendar_move() still work correctly.

Refactor out range checks and replace them by a single check that is
performed *after* the new date is computed, but before we assign the new
value to the actual selected date. This ensures we won't have to bother
about these again when changing/adding functionality in/to
calendar_move(), while keeping performance (date_change() is pretty
cheap and range violations are corner cases anyway).

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-01-21 23:06:12 +01:00

25 KiB