commit - f31d6c3bb64ee3c4dc056588d559b58a9174ba59
commit + 86f4aab9e588b1f19647a7d8a2492a262e960fed
blob - 6ae32ea1ad6c310b00c6dae70527e7313d433e6c
blob + e3dfe0b0fa8499bd5718d635b375246f49a08b43
--- tog/tog.c
+++ tog/tog.c
wstandout(view->window);
tc = get_color(&s->colors, TOG_COLOR_COMMIT);
if (tc)
- wattr_on(view->window,
- COLOR_PAIR(tc->colorpair), NULL);
+ wattr_on(view->window, COLOR_PAIR(tc->colorpair), NULL);
waddwstr(view->window, wline);
- if (tc)
- wattr_off(view->window,
- COLOR_PAIR(tc->colorpair), NULL);
while (width < view->ncols) {
waddch(view->window, ' ');
width++;
}
+ if (tc)
+ wattr_off(view->window, COLOR_PAIR(tc->colorpair), NULL);
if (view_needs_focus_indication(view))
wstandend(view->window);
free(wline);
waddwstr(view->window, wline);
free(wline);
wline = NULL;
+ while (width++ < view->ncols)
+ waddch(view->window, ' ');
if (view_needs_focus_indication(view))
wstandend(view->window);
- if (width <= view->ncols - 1)
- waddch(view->window, '\n');
if (max_lines <= 1)
return NULL;
wstandout(view->window);
tc = get_color(&s->colors, TOG_COLOR_COMMIT);
if (tc)
- wattr_on(view->window,
- COLOR_PAIR(tc->colorpair), NULL);
+ wattr_on(view->window, COLOR_PAIR(tc->colorpair), NULL);
waddwstr(view->window, wline);
+ while (width++ < view->ncols)
+ waddch(view->window, ' ');
if (tc)
- wattr_off(view->window,
- COLOR_PAIR(tc->colorpair), NULL);
+ wattr_off(view->window, COLOR_PAIR(tc->colorpair), NULL);
if (view_needs_focus_indication(view))
wstandend(view->window);
free(wline);
wline = NULL;
- if (width < view->ncols - 1)
- waddch(view->window, '\n');
if (view->gline > blame->nlines)
view->gline = blame->nlines;
const struct got_error *err = NULL;
struct got_tree_entry *te;
wchar_t *wline;
+ char *index = NULL;
struct tog_color *tc;
int width, n, nentries, i = 1;
int limit = view->nlines;
wstandout(view->window);
tc = get_color(&s->colors, TOG_COLOR_COMMIT);
if (tc)
- wattr_on(view->window,
- COLOR_PAIR(tc->colorpair), NULL);
+ wattr_on(view->window, COLOR_PAIR(tc->colorpair), NULL);
waddwstr(view->window, wline);
+ free(wline);
+ wline = NULL;
+ while (width++ < view->ncols)
+ waddch(view->window, ' ');
if (tc)
- wattr_off(view->window,
- COLOR_PAIR(tc->colorpair), NULL);
+ wattr_off(view->window, COLOR_PAIR(tc->colorpair), NULL);
if (view_needs_focus_indication(view))
wstandend(view->window);
- free(wline);
- wline = NULL;
+ if (--limit <= 0)
+ return NULL;
i += s->selected;
if (s->first_displayed_entry) {
++i; /* account for ".." entry */
}
nentries = got_object_tree_get_nentries(s->tree);
- wprintw(view->window, " [%d/%d]", i,
- nentries + (s->tree == s->root ? 0 : 1)); /* ".." in !root tree */
-
- if (width < view->ncols - 1)
- waddch(view->window, '\n');
- if (--limit <= 0)
- return NULL;
- err = format_line(&wline, &width, NULL, parent_path, 0, view->ncols,
- 0, 0);
+ if (asprintf(&index, "[%d/%d] %s",
+ i, nentries + (s->tree == s->root ? 0 : 1), parent_path) == -1)
+ return got_error_from_errno("asprintf");
+ err = format_line(&wline, &width, NULL, index, 0, view->ncols, 0, 0);
+ free(index);
if (err)
return err;
waddwstr(view->window, wline);
if (view_needs_focus_indication(view))
wstandout(view->window);
waddwstr(view->window, wline);
+ while (width++ < view->ncols)
+ waddch(view->window, ' ');
if (view_needs_focus_indication(view))
wstandend(view->window);
free(wline);
wline = NULL;
free(line);
line = NULL;
- if (width < view->ncols - 1)
- waddch(view->window, '\n');
if (--limit <= 0)
return NULL;