-rw-r--r-- | cgit.c | 2 | ||||
-rw-r--r-- | cgit.h | 1 | ||||
-rw-r--r-- | cgitrc.5.txt | 4 | ||||
-rw-r--r-- | ui-tree.c | 5 |
4 files changed, 12 insertions, 0 deletions
@@ -67,4 +67,6 @@ void config_cb(const char *name, const char *value) else if (!strcmp(name, "logo-link")) ctx.cfg.logo_link = xstrdup(value); + else if (!strcmp(name, "linenumbers")) + ctx.cfg.linenumbers = atoi(value); else if (!strcmp(name, "module-link")) ctx.cfg.module_link = xstrdup(value); @@ -175,4 +175,5 @@ struct cgit_config { int enable_log_linecount; int local_time; + int linenumbers; int max_repo_count; int max_commit_count; diff --git a/cgitrc.5.txt b/cgitrc.5.txt index 3c35b02..a762ccc 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@ -147,4 +147,8 @@ logo-link:: value: none. +linenumbers:: + If set to "1" lines in tree view will have numbers. + Default value: "0". + max-commit-count:: Specifies the number of entries to list per page in "log" view. Default @@ -24,4 +24,5 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size) html("<table summary='blob content' class='blob'>\n"); + if (ctx.cfg.linenumbers) { html("<tr><td class='linenumbers'><pre>"); idx = 0; @@ -37,4 +38,8 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size) } html("</pre></td>\n"); + } + else { + html("<tr>\n"); + } if (ctx.repo->source_filter) { |