{#each file.hunks as hunk, hunkIndex} {@const beforeLines = getExpandedBefore(hunkIndex)} {@const afterLines = getExpandedAfter(hunkIndex)} {#if shouldShowHeader(hunkIndex)}
{#if canExpandBefore(hunkIndex)} {/if} {hunk.header} {#if $vcs !== 'jj'} {/if}
{/if} {#if $viewMode === 'unified'} {#each beforeLines as line} {@const lineNum = line.newNumber || line.oldNumber || 0}
{line.oldNumber ?? ''} {line.newNumber ?? ''} {#if line.html}{@html line.html}{:else}{line.content || ' '}{/if}
{/each} {#each hunk.lines as line} {@const lineNum = getLineKey(line)} {@const side = getLineSide(line)} {@const lineThreads = getThreadsForLine(lineNum, side)}
{line.oldNumber ?? ''} {line.newNumber ?? ''} {line.type === 'add' ? '+' : line.type === 'del' ? '-' : ' '} {#if line.html}{@html line.html}{:else}{line.content || ' '}{/if}
{#each lineThreads as thread}{/each} {#if isCommenting(lineNum, side)}{/if} {/each} {#each afterLines as line} {@const lineNum = line.newNumber || line.oldNumber || 0}
{line.oldNumber ?? ''} {line.newNumber ?? ''} {#if line.html}{@html line.html}{:else}{line.content || ' '}{/if}
{/each} {#if canExpandAfter(hunkIndex)}
{/if} {:else} {#each beforeLines as line}
{line.oldNumber ?? ''} {#if line.html}{@html line.html}{:else}{line.content || ' '}{/if}
{line.newNumber ?? ''} {#if line.html}{@html line.html}{:else}{line.content || ' '}{/if}
{/each} {@const pairs = buildSplitPairs(hunk.lines)} {#each pairs as pair} {@const oldThreads = pair.old ? getThreadsForLine(pair.old.oldNumber!, 'old') : []} {@const newThreads = pair.new ? getThreadsForLine(pair.new.newNumber!, 'new') : []}
{#if pair.old}
{pair.old.oldNumber ?? ''} {pair.old.type === 'del' ? '-' : ' '} {#if pair.old.html}{@html pair.old.html}{:else}{pair.old.content || ' '}{/if}
{:else}
 
{/if}
{#if pair.new}
{pair.new.newNumber ?? ''} {pair.new.type === 'add' ? '+' : ' '} {#if pair.new.html}{@html pair.new.html}{:else}{pair.new.content || ' '}{/if}
{:else}
 
{/if}
{#if oldThreads.length > 0 || newThreads.length > 0}
{#each oldThreads as thread}{/each} {#if pair.old && isCommenting(pair.old.oldNumber!, 'old')}{/if}
{#each newThreads as thread}{/each} {#if pair.new && isCommenting(pair.new.newNumber!, 'new')}{/if}
{/if} {/each} {#each afterLines as line}
{line.oldNumber ?? ''} {#if line.html}{@html line.html}{:else}{line.content || ' '}{/if}
{line.newNumber ?? ''} {#if line.html}{@html line.html}{:else}{line.content || ' '}{/if}
{/each} {#if canExpandAfter(hunkIndex)}
{/if} {/if} {/each} {#if file.truncated}

Large file: showing {file.hunks.reduce((s, h) => s + h.lines.length, 0).toLocaleString()} of {(file.totalLines || 0).toLocaleString()} changed lines

{/if}