commit df4a593ade550cd6ff751fead5b8db5514346f44
parent 707da47ca8139fe8593755590e14c0706a904eed
Author: Andreas Gruhler <agruhl@gmx.ch>
Date: Sun, 5 Dec 2021 16:28:17 +0100
redraw calendar on resize
This was part of the code in pull request #39. These simple lines of
code will catch the KEY_RESIZE char and respond with a move (go_to) to
the same date.
The part that will take care of the actual resizing are at the end of
the go_to function (prefresh of calendar window). This updates the aside
and calendar.
It will not update the preview window. The code that updates the preview
window is at the end of the while (wresize).
Co-authored-by: livibetter <livibetter@gmail.com>
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/diary.c b/src/diary.c
@@ -532,6 +532,10 @@ int main(int argc, char** argv) {
edit_cmd(CONFIG.dir, diary_dir_size, &new_date, &pecmd, sizeof ecmd);
switch(ch) {
+ // redraw on win resize
+ case KEY_RESIZE:
+ mv_valid = go_to(cal, aside, mktime(&new_date), &pad_pos, &curs_date, &cal_start, &cal_end);
+ break;
// basic movements
case 'j':
case KEY_DOWN: