gitea/services/gitdiff
wxiaoguang 0d8bd7720d
Refactor highlight and diff (#36599)
1. fix a performance regression when using line-by-line highlighting
* the root cause is that chroma's `lexers.Get` is slow and a lexer cache
is missing during recent changes
2. clarify the chroma lexer detection behavior
* now we fully manage our logic to detect lexer, and handle overriding
problems, everything is fully under control
3. clarify "code analyze" behavior, now only 2 usages:
* only use file name and language to detect lexer (very fast), mainly
for "diff" page which contains a lot of files
* if no lexer is detected by file name and language, use code content to
detect again (slow), mainly for "view file" or "blame" page, which can
get best result
4. fix git diff bug, it caused "broken pipe" error for large diff files
2026-02-13 00:15:46 +00:00
..
csv.go Run `gopls modernize` on codebase (#34751) 2025-06-18 01:48:09 +00:00
csv_test.go Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
git_diff_tree.go Improve diff file headers (#36215) 2026-01-12 20:29:35 +08:00
git_diff_tree_test.go Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
gitdiff.go Refactor highlight and diff (#36599) 2026-02-13 00:15:46 +00:00
gitdiff_excerpt.go Refactor highlight and diff (#36599) 2026-02-13 00:15:46 +00:00
gitdiff_excerpt_test.go Use full-file highlighting for diff sections (#36561) 2026-02-10 03:29:28 +00:00
gitdiff_test.go Use full-file highlighting for diff sections (#36561) 2026-02-10 03:29:28 +00:00
highlightdiff.go Fine tune diff highlighting (#36592) 2026-02-12 07:01:36 +00:00
highlightdiff_test.go Refactor highlight and diff (#36599) 2026-02-13 00:15:46 +00:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
submodule.go Improve submodule relative path handling (#35056) 2025-07-14 23:28:34 +08:00
submodule_test.go Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00