commit - d6df9be4197af7d3df1c763a67efd39444524497
commit + 31120ada8e3c6ed9981b9ae3fd6551ce495171f9
blob - 9834ac493f764723c82a8411cb0a71540dd5a5c0
blob + aee7598b9342a43b833c48420d6b91ef0262c110
--- tog/tog.c
+++ tog/tog.c
#include <sys/queue.h>
+#include <errno.h>
#include <curses.h>
#include <panel.h>
#include <locale.h>
free_commits(&commits);
err = fetch_commits(&commits, obj, id, repo, LINES);
refetch_commits = 0;
- got_object_close(obj);
- obj = NULL;
if (err)
goto done;
}
-redraw:
+
err = draw_commits(&commits, selected);
if (err)
goto done;
nodelay(stdscr, FALSE);
ch = wgetch(tog_log_view.window);
switch (ch) {
+ case ERR:
+ if (errno) {
+ err = got_error_from_errno();
+ goto done;
+ }
+ break;
case 'q':
done = 1;
break;
selected++;
break;
case KEY_RESIZE:
- goto redraw;
+ refetch_commits = 1;
+ if (selected > LINES)
+ selected = LINES - 1;
+ break;
default:
break;
}