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.

#63

Highlight syntax in diff views

merged · by keenan 12d ago · merged into main at cfd43dcd by keenan 12d ago

keenan opened this 12d ago

Why

The code browser highlights a blob, but the commit, compare, and change-request Files views render the same source as plain text. Reviewing a diff is where colour helps most.

What changed

  • diffFile now carries a Prism language derived from the new path, or the old path for a deletion.
  • The shared diff template carries that language on the file section and marks every code cell as old or new.
  • app.js queues a diff once per side. Highlighting old and new as one stream would let a multiline comment or string started on one side colour lines from the other.
  • The token palette now covers diff cells as well as blob cells.
  • Added tests for language selection (including deletions and renames) and for the rendered diff markers.

Verification

  • node --check server/web/static/app.js
  • go test ./... -count=1
  • vole workflow check
  • vole workflow run verify (format, vet, build, govulncheck, packaging, links, race tests)

This is separate from #62: that request fixes the Prism worker and HTMX/CSP errors; this one adds highlighting to diffs.

Discussion (0)

No discussion yet.