History

ui-log: (ab)use extra columns for commit message when showmsg=1

If the commit message has extra long lines it's better to use the author/ files/lines columns to show those lines than to push the columns of screen and force the users to hscroll.

Lars Hjemli committed 17 years ago

Commit 951f5501 parent 0274b571 file · +7 −6Browse files

Unified · Split

ui-log.c+7−6
@@ -35,6 +35,7 @@ void print_commit(struct commit *commit) · 34 unmodified lines
3535 {
3636 struct commitinfo *info;
3737 char *tmp;
38+ int cols = 2;
3839
3940 info = cgit_parse_commit(commit);
4041 html("<tr><td>");
@@ -66,15 +67,15 @@ void print_commit(struct commit *commit) · 25 unmodified lines
6667 }
6768 html("</td></tr>\n");
6869 if (ctx.qry.showmsg) {
69− html("<tr class='nohover'><td></td><td><div class='commit-msg'>");
70− html_txt(info->msg);
71− html("</div><br/></td><td></td>");
7270 if (ctx.repo->enable_log_filecount) {
73− html("<td></td>");
71+ cols++;
7472 if (ctx.repo->enable_log_linecount)
75− html("<td></td>");
73+ cols++;
7674 }
77− html("</tr>\n");
75+ htmlf("<tr class='nohover'><td></td><td colspan='%d'><div class='commit-msg'>",
76+ cols);
77+ html_txt(info->msg);
78+ html("</div><br/></td></tr>\n");
7879 }
7980 cgit_free_commitinfo(info);
8081 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t