Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Highlight syntax in diff views

e7982ac5137be6e891616cdcdedc035f9019f99b · Keenan Nemetz · 12d ago · parent a76b2f38

Highlight syntax in diff views

The diff parser now names each file's Prism language from the new path (or the old path for a deletion), and the shared diff template carries that language plus the side of every line. app.js queues a diff once per side, so an old-side string or comment cannot colour new-side lines, and the token palette now covers diff cells as well as blobs.

The commit, compare, and change-request Files views all use the same template, so they gain highlighting together.

server/web/static/vole.css +40−39

@@ -1124,45 +1124,46 @@ details[open] > summary .tree-chevron { transform: rotate(90deg); }
1124 1124
1125 1125 /* ---------- syntax highlighting ---------- */
1126 1126
1127 /* static/prism-worker.js writes Prism token classes into the cells after the
1128 page paints. The palette is the same one the rest of the surface uses, so a
1129 token is a colour, never a font switch except for comments and italics. */
1130
1131 .blob .token.comment,
1132 .blob .token.prolog,
1133 .blob .token.doctype,
1134 .blob .token.cdata { color: #6f7682; font-style: italic; }
1135 .blob .token.punctuation { color: #a6accd; }
1136 .blob .token.namespace { color: #a6accd; }
1137 .blob .token.operator,
1138 .blob .token.entity,
1139 .blob .token.url { color: #7fd3e8; }
1140 .blob .token.boolean,
1141 .blob .token.number,
1142 .blob .token.constant,
1143 .blob .token.symbol { color: #f2a06b; }
1144 .blob .token.string,
1145 .blob .token.char,
1146 .blob .token.attr-value,
1147 .blob .token.regex { color: #a8d98a; }
1148 .blob .token.atrule,
1149 .blob .token.keyword,
1150 .blob .token.tag,
1151 .blob .token.selector { color: #c792ea; }
1152 .blob .token.function,
1153 .blob .token.function-name,
1154 .blob .token.method { color: #83aaff; }
1155 .blob .token.class-name,
1156 .blob .token.builtin,
1157 .blob .token.attr-name,
1158 .blob .token.property,
1159 .blob .token.title { color: #f0c674; }
1160 .blob .token.variable { color: #e7e8ea; }
1161 .blob .token.deleted { color: var(--bad); }
1162 .blob .token.inserted { color: var(--good); }
1163 .blob .token.important,
1164 .blob .token.bold { font-weight: 600; }
1165 .blob .token.italic { font-style: italic; }
1127 /* static/prism-worker.js writes Prism token classes into blob and diff cells
1128 after the page paints. The palette is the same one the rest of the surface
1129 uses, so a token is a colour, never a font switch except for comments and
1130 italics. */
1131
1132 :is(.blob, .diff) .token.comment,
1133 :is(.blob, .diff) .token.prolog,
1134 :is(.blob, .diff) .token.doctype,
1135 :is(.blob, .diff) .token.cdata { color: #6f7682; font-style: italic; }
1136 :is(.blob, .diff) .token.punctuation { color: #a6accd; }
1137 :is(.blob, .diff) .token.namespace { color: #a6accd; }
1138 :is(.blob, .diff) .token.operator,
1139 :is(.blob, .diff) .token.entity,
1140 :is(.blob, .diff) .token.url { color: #7fd3e8; }
1141 :is(.blob, .diff) .token.boolean,
1142 :is(.blob, .diff) .token.number,
1143 :is(.blob, .diff) .token.constant,
1144 :is(.blob, .diff) .token.symbol { color: #f2a06b; }
1145 :is(.blob, .diff) .token.string,
1146 :is(.blob, .diff) .token.char,
1147 :is(.blob, .diff) .token.attr-value,
1148 :is(.blob, .diff) .token.regex { color: #a8d98a; }
1149 :is(.blob, .diff) .token.atrule,
1150 :is(.blob, .diff) .token.keyword,
1151 :is(.blob, .diff) .token.tag,
1152 :is(.blob, .diff) .token.selector { color: #c792ea; }
1153 :is(.blob, .diff) .token.function,
1154 :is(.blob, .diff) .token.function-name,
1155 :is(.blob, .diff) .token.method { color: #83aaff; }
1156 :is(.blob, .diff) .token.class-name,
1157 :is(.blob, .diff) .token.builtin,
1158 :is(.blob, .diff) .token.attr-name,
1159 :is(.blob, .diff) .token.property,
1160 :is(.blob, .diff) .token.title { color: #f0c674; }
1161 :is(.blob, .diff) .token.variable { color: #e7e8ea; }
1162 :is(.blob, .diff) .token.deleted { color: var(--bad); }
1163 :is(.blob, .diff) .token.inserted { color: var(--good); }
1164 :is(.blob, .diff) .token.important,
1165 :is(.blob, .diff) .token.bold { font-weight: 600; }
1166 :is(.blob, .diff) .token.italic { font-style: italic; }
1166 1167
1167 1168 /* ---------- repository overview sidebar ---------- */
1168 1169