From d67cc7f9d556650438e421cdcda37bc52710bffd Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 9 Aug 2009 20:42:45 +0000 Subject: Add 'linenumbers' config option Signed-off-by: Florian Pritz Signed-off-by: Lars Hjemli --- ui-tree.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'ui-tree.c') diff --git a/ui-tree.c b/ui-tree.c index 7bf2ad2..f64e6e0 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -23,19 +23,24 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size) html("\n"); - html("\n"); + } + else { + html("\n"); } - html("\n"); if (ctx.repo->source_filter) { html("
");
-	idx = 0;
-	lineno = 0;
-
-	if (size) {
-		htmlf(numberfmt, ++lineno);
-		while(idx < size - 1) { // skip absolute last newline
-			if (buf[idx] == '\n')
-				htmlf(numberfmt, ++lineno);
-			idx++;
+	if (ctx.cfg.linenumbers) {
+		html("
");
+		idx = 0;
+		lineno = 0;
+	
+		if (size) {
+			htmlf(numberfmt, ++lineno);
+			while(idx < size - 1) { // skip absolute last newline
+				if (buf[idx] == '\n')
+					htmlf(numberfmt, ++lineno);
+				idx++;
+			}
 		}
+		html("
");
-- 
cgit