On 2018-07-01 19:52, Lester L. Martin II wrote:
Note:

Have noticed that the functions, utilized without highlighting,
actually generate 2 new lines, one at the beginning, and one at
the end. This breaks line numbering (file grew longer in lines).
Believe this has existed *before* I worked on my syntax
highlighting and line numbering patch. If anyone can confirm
this is the case in Fossil 2.6 (have to inspect the html
markup), please let me know. This behaviour isn't exhibited
in the default builtin line numbering code, just the
non-line-numbering code.

Will follow up with a patch to fix that as well likely.

The fix (patch is redone) is as follows:
Index: src/db.c
==================================================================
--- /home/masky/misc/fossil/src/db.c~0 2018-07-01 20:02:18.687830000 -0500
+++ /home/masky/misc/fossil/src/db.c    2018-07-01 16:34:01.746686000 -0500
@@ -3263,0 +3264,5 @@
+/*
+** SETTING: syntax-hl        boolean default=off
+** This is a boolean set such that themes can use TH1 code
+** to detect if they should enable syntax highlighting.
+*/
Index: src/info.c
==================================================================
--- /home/masky/misc/fossil/src/info.c~0 2018-07-01 20:02:18.714191000 -0500 +++ /home/masky/misc/fossil/src/info.c 2018-07-01 19:57:46.872570000 -0500
@@ -670 +670 @@
-
+
@@ -2155 +2154,0 @@
-      @ <blockquote>
@@ -2157 +2156,2 @@
-        const char *z;
+        const char *z, *ext, *name;
+        char *tmp;
@@ -2159 +2159,6 @@
-        if( zLn ){
+        name = blob_str(&downloadName);
+        ext = (tmp = strrchr(name, '.')) == NULL ? "" : tmp+1;
+        @ <pre>
+        if( zLn && (db_get_boolean("syntax-hl", 0) != 0) ) {
+          @ <code class="%h(ext)">%h(z)</code>
+        }else if( zLn ){
@@ -2162,3 +2167 @@
-          @ <pre>
-          @ %h(z)
-          @ </pre>
+          @ <code class="%h(ext)">%h(z)</code>
@@ -2165,0 +2169 @@
+        @ </pre>
@@ -2166,0 +2171 @@
+        @ <blockquote>
@@ -2169,0 +2175 @@
+        @ </blockquote>
@@ -2170,0 +2177 @@
+        @ <blockquote>
@@ -2171,0 +2179 @@
+        @ </blockquote>
@@ -2173 +2180,0 @@
-      @ </blockquote>
@@ -2232 +2239 @@
-      ? db_text("(No title)",
+      ? db_text("(No title)",


--
Lester L. Martin II
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to