Index: src/db.c ================================================================== --- src/db.c +++ src/db.c @@ -3600,10 +3600,15 @@ ** A shell command used to launch your preferred ** web browser when given a URL as an argument. ** Defaults to "start" on windows, "open" on Mac, ** and "firefox" on Unix. */ +/* +** 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. +*/ /* ** Look up a control setting by its name. Return a pointer to the Setting ** object, or NULL if there is no such setting. ** Index: src/info.c ================================================================== --- src/info.c +++ src/info.c @@ -2338,27 +2338,20 @@ } blob_to_utf8_no_bom(&content, 0); zMime = mimetype_from_content(&content); @
if( zMime==0 ){ - const char *z, *zFileName, *zExt; + const char *z, *zFileName, *zExt, *zLanguage, *tmp; z = blob_str(&content); - zFileName = db_text(0, - "SELECT name FROM mlink, filename" - " WHERE filename.fnid=mlink.fnid" - " AND mlink.fid=%d", - rid); - zExt = zFileName ? strrchr(zFileName, '.') : 0; - if( zLn ){ + zFileName = blob_str(&downloadName); + zExt = (tmp = strrchr(zFileName, '.')) == NULL ? "" : tmp+1; + zLanguage = strrchr(zFileName, '.') == NULL ? "" : "language-"; + if( zLn && (db_get_boolean("syntax-hl", 0) == 0) ) { output_text_with_line_numbers(z, zLn); - }else if( zExt && zExt[1] ){ - @
-          @ %h(z)
-          @ 
}else{ @
-          @ %h(z)
+          @ %h(z)
           @ 
} }else if( strncmp(zMime, "image/", 6)==0 ){ @

(file is %d(blob_size(&content)) bytes of image data)

@