X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/566f92b27618f67f59cc3642e17d9cb9c12634fa..b115955d71c50cd2d0065c45f3df6b02fa4730bd:/ui-tree.c
diff --git a/ui-tree.c b/ui-tree.c
index 9a837e2..c26ba4c 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -18,8 +18,8 @@ static void print_object(const unsigned char *sha1, char *path)
{
enum object_type type;
char *buf;
- unsigned long size, lineno, start, idx;
- const char *linefmt = "
| %1$d | ";
+ unsigned long size, lineno, idx;
+ const char *numberfmt = "%1$d\n";
type = sha1_object_info(sha1, &size);
if (type == OBJ_BAD) {
@@ -35,28 +35,31 @@ static void print_object(const unsigned char *sha1, char *path)
return;
}
- html(" blob: %s",sha1_to_hex(sha1));
+ html(" (");
+ cgit_plain_link("plain", NULL, NULL, ctx.qry.head,
+ curr_rev, path);
+ htmlf(") blob: %s\n", sha1_to_hex(sha1));
html("\n");
+ html("\n");
+
+ html("");
idx = 0;
- start = 0;
lineno = 0;
- while(idx < size) {
+ htmlf(numberfmt, ++lineno);
+ while(idx < size - 1) { // skip absolute last newline
if (buf[idx] == '\n') {
- buf[idx] = '\0';
- htmlf(linefmt, ++lineno);
- html_txt(buf + start);
- html(" | \n");
- start = idx + 1;
+ htmlf(numberfmt, ++lineno);
}
idx++;
}
- htmlf(linefmt, ++lineno);
- html_txt(buf + start);
- html("\n");
+ html("\n");
+
+ html("");
+ html_txt(buf);
+ html("
| \n");
+
+ html("\n");
html(" \n");
}
@@ -106,7 +109,10 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen,
html(" | ");
cgit_log_link("log", NULL, "button", ctx.qry.head, curr_rev,
- fullpath, 0, NULL, NULL);
+ fullpath, 0, NULL, NULL, ctx.qry.showmsg);
+ if (ctx.repo->max_stats)
+ cgit_stats_link("stats", NULL, "button", ctx.qry.head,
+ fullpath);
html(" |
\n");
free(name);
return 0;