diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-06-12 23:12:51 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-06-13 00:12:32 +0200 |
commit | cabc22e032b933a84335da9acbbf0721eed9c63f (patch) | |
tree | 3a4915b68672986d1a3fb1228d78e40cc80b103c /src/calendar.c | |
parent | 42c486d30d8e6f82d27651e19029e332af86cba3 (diff) | |
download | calcurse-cabc22e032b933a84335da9acbbf0721eed9c63f.zip |
Add key bindings to go to the previous/next month/year
In addition to generic key bindings for moving one day (week)
forward/backward, define similar bindings for moving a month or a year.
Of course, count prefixes are allowed here as well.
Also add status bar hints and help texts.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/calendar.c')
-rw-r--r-- | src/calendar.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/calendar.c b/src/calendar.c index dbac9c7..a157caa 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -626,6 +626,18 @@ void calendar_move(enum move move, int count) case WEEK_NEXT: ret = date_change(&t, 0, count * WEEKINDAYS); break; + case MONTH_PREV: + ret = date_change(&t, -count, 0); + break; + case MONTH_NEXT: + ret = date_change(&t, count, 0); + break; + case YEAR_PREV: + ret = date_change(&t, -count * YEARINMONTHS, 0); + break; + case YEAR_NEXT: + ret = date_change(&t, count * YEARINMONTHS, 0); + break; case WEEK_START: /* Normalize struct tm to get week day number. */ mktime(&t); |