diff --git a/static/app.js b/static/app.js index 7d3b9e0..c4d80a8 100644 --- a/static/app.js +++ b/static/app.js @@ -632,6 +632,7 @@ function parseUnifiedDiff(text) { const files = []; let cur = null; let oldNo = 0, newNo = 0; + let inHunk = false; // 词级模式(--word-diff=plain)下 git 的上下文行不带前导空格,需据此兜底 const push = (header) => { cur = { header, rows: [] }; files.push(cur); return cur; }; for (const line of lines) { if (line.startsWith('diff --git') || line.startsWith('Index: ')) { push(line); continue; }