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/diff.go +12−6

@@ -15,12 +15,13 @@ import (
15 15 )
16 16
17 17 type diffFile struct {
18 OldPath string
19 NewPath string
20 Binary bool
21 Hunks []diffHunk
22 Added int
23 Removed int
18 OldPath string
19 NewPath string
20 Binary bool
21 Language string // the Prism language for Label, or "" when it is not known
22 Hunks []diffHunk
23 Added int
24 Removed int
24 25 }
25 26
26 27 // Label is what to show as the file's name: the new path, or the old one for a
@@ -80,6 +81,11 @@ func parseDiff(patch string) []diffFile {
80 81 flushFile := func() {
81 82 flushHunk()
82 83 if cur != nil {
84 name := cur.NewPath
85 if name == "" {
86 name = cur.OldPath
87 }
88 cur.Language = prismLanguage(name)
83 89 files = append(files, *cur)
84 90 cur = nil
85 91 }