commit - e350feedfce6b6a668fc796711cf1443e384789d
commit + 00ba99a7be48f532c0673f3e2ada13d7c299b2a0
blob - 61e31cf94d4b170cbae9f3517a70d5a82ae92bec
blob + 2eba1c88fc52a8357df23a0fadc188dae4ddbe27
--- tog/tog.c
+++ tog/tog.c
view_is_splitscreen(struct tog_view *view)
{
return view->begin_x > 0;
-}
-
-/*
- * Erase all content of the view. Can be used to "flash" the view because
- * the view loop will redraw it quickly, providing a more subtle visual
- * effect than curs_flash(3) would provide.
- */
-static void
-view_flash(struct tog_view *view)
-{
- werase(view->window);
- update_panels();
- doupdate();
}
static void
int nscrolled = 0;
entry = TAILQ_FIRST(&commits->head);
- if (*first_displayed_entry == entry) {
- view_flash(view);
+ if (*first_displayed_entry == entry)
return;
- }
entry = *first_displayed_entry;
while (entry && nscrolled < maxscroll) {
do {
pentry = TAILQ_NEXT(*last_displayed_entry, entry);
- if (pentry == NULL) {
- if (*log_complete)
- view_flash(view);
+ if (pentry == NULL)
break;
- }
*last_displayed_entry = pentry;
break;
if (TAILQ_FIRST(&s->commits.head) ==
s->first_displayed_entry) {
- if (s->selected == 0) {
- view_flash(view);
- break;
- }
s->selected = 0;
break;
}
case KEY_UP:
if (s->first_displayed_line > 1)
s->first_displayed_line--;
- else
- view_flash(view);
break;
case KEY_PPAGE:
- if (s->first_displayed_line == 1) {
- view_flash(view);
+ if (s->first_displayed_line == 1)
break;
- }
i = 0;
while (i++ < view->nlines - 1 &&
s->first_displayed_line > 1)
case KEY_DOWN:
if (!s->eof)
s->first_displayed_line++;
- else
- view_flash(view);
break;
case KEY_NPAGE:
case ' ':
- if (s->eof) {
- view_flash(view);
+ if (s->eof)
break;
- }
i = 0;
while (!s->eof && i++ < view->nlines - 1) {
char *line;
else if (s->selected_line == 1 &&
s->first_displayed_line > 1)
s->first_displayed_line--;
- else
- view_flash(view);
break;
case KEY_PPAGE:
if (s->first_displayed_line == 1) {
- if (s->selected_line == 1) {
- view_flash(view);
- break;
- }
s->selected_line = 1;
break;
}
else if (s->last_displayed_line <
s->blame.nlines)
s->first_displayed_line++;
- else
- view_flash(view);
break;
case 'b':
case 'p': {
case ' ':
if (s->last_displayed_line >= s->blame.nlines &&
s->selected_line >= MIN(s->blame.nlines,
- view->nlines - 2)) {
- view_flash(view);
+ view->nlines - 2)) {
break;
}
if (s->last_displayed_line >= s->blame.nlines &&
struct got_tree_entry *te, *prev;
int i;
- if (*first_displayed_entry == NULL) {
- view_flash(view);
+ if (*first_displayed_entry == NULL)
return;
- }
te = SIMPLEQ_FIRST(&entries->head);
if (*first_displayed_entry == te) {
- view_flash(view);
if (!isroot)
*first_displayed_entry = NULL;
return;
s->selected++;
break;
}
- if (SIMPLEQ_NEXT(s->last_displayed_entry, entry)
- == NULL) {
+ if (SIMPLEQ_NEXT(s->last_displayed_entry, entry) == NULL)
/* can't scroll any further */
- view_flash(view);
break;
- }
tree_scroll_down(&s->first_displayed_entry, 1,
s->last_displayed_entry, s->entries);
break;
/* can't scroll any further; move cursor down */
if (s->selected < s->ndisplayed - 1)
s->selected = s->ndisplayed - 1;
- else
- view_flash(view);
break;
}
nscrolled = tree_scroll_down(&s->first_displayed_entry,