From 018d6ca1b5e82cf7fc774ea264a365d87e85a9b2 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 25 Oct 2026 12:44:00 -1000 Subject: Let a commit's labels wrap apart from its subject The labels sat flush against the subject's last word, which made the two one unbreakable run, so a narrow cell stranded a word on its own line. A space now precedes each label and carries its gap, and a line that breaks there drops it, so a wrapped label starts flush. --- source/ui-log.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source') diff --git a/source/ui-log.c b/source/ui-log.c index 2812246..a01ef4e 100644 --- a/source/ui-log.c +++ b/source/ui-log.c @@ -428,14 +428,18 @@ void cgit_print_commit_decorations(struct commit *commit) int is_annotated = 0; buf = prettify_refname(deco->name); + // The space ahead of each label is where a narrow cell may break + // the line, and the stylesheet widens it into the gap. switch (deco->type) { case DECORATION_NONE: break; case DECORATION_REF_LOCAL: + html(" "); cgit_log_link(buf, NULL, "branch-deco", buf, NULL, ctx.qry.vpath, 0, NULL, NULL, ctx.qry.showmsg, 0); break; case DECORATION_REF_TAG: + html(" "); if (!refs_read_ref(get_main_ref_store(the_repository), deco->name, &oid_tag) && !peel_object(the_repository, &oid_tag, &peeled, PEEL_OBJECT_VERIFY_TAGGED_OBJECT_TYPE)) @@ -445,12 +449,14 @@ void cgit_print_commit_decorations(struct commit *commit) case DECORATION_REF_REMOTE: if (!ctx.repo->enable_remote_branches) break; + html(" "); cgit_log_link( buf, NULL, "remote-deco", NULL, oid_to_hex(&commit->object.oid), ctx.qry.vpath, 0, NULL, NULL, ctx.qry.showmsg, 0 ); break; default: + html(" "); cgit_commit_link(buf, NULL, "deco", ctx.qry.head, oid_to_hex(&commit->object.oid), ctx.qry.vpath); break; -- cgit 2.9.2