bug(crash): thread panic while loading file diff
Author: sgtrustyCreated Aug 20, 2026Updated Aug 20, 2026
Describe the bug
Error while using lazygit. Visualized below:
Full text stack:
thread 'main' (429902) panicked at src/display/hunks.rs:518:17:
internal error: entered unreachable code: Should be impossible: every LHS Unchanged MatchedPos should have a corresponding RHS Unchanged MatchedPos
None
Some(MatchedPos {
kind: UnchangedToken {
highlight: Delimiter,
self_pos: [SingleLineSpan { line: LineNumber: 158 (zero-indexed: 157), start_col: 0, end_col: 1 }],
opposite_pos: [SingleLineSpan { line: LineNumber: 170 (zero-indexed: 169), start_col: 0, end_col: 1 }]
},
pos: SingleLineSpan { line: LineNumber: 158 (zero-indexed: 157), start_col: 0, end_col: 1 }
})
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal: external diff died, stopping at src/routes/post/upload.tsxTo Reproduce
Before file:
import React, { Component } from 'react'
interface TagsInputProps {
tags: string
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void
}
export class TagsInput extends Component<TagsInputProps> {
render() {
return (
<label className="flex flex-col gap-1.5">
<span className="text-sm font-medium text-[var(--sea-ink-soft)]">
Tags{' '}
</span>
<input
type="text"
value={this.props.tags}
onChange={this.props.onChange}
placeholder="Tags: nature, sunset, ocean"
className="rounded-xl border border-[var(--line)] bg-white/60 px-3 py-2 text-sm text-[var(--sea-ink)] outline-none focus:border-[var(--lagoon-deep)]"
/>
</label>
)
}
}After file:
import React, { Component } from 'react'
interface TagsInputProps {
tags: string
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void
}
export class TagsInput extends Component<TagsInputProps> {
render() {
return (
<label className="flex flex-col gap-1.5">
<span className="text-sm font-medium text-[var(--sea-ink-soft)]">
Tags
</span>
<input
type="text"
value={tags}
onChange={(e) => setTags(e.target.value)}
placeholder="nature, sunset, ocean"
className="rounded-xl border border-[var(--line)] bg-white/60 px-3 py-2 text-sm text-[var(--sea-ink)] outline-none focus:border-[var(--lagoon-deep)]"
/>
</label>
)
}
}Expected behavior
Lines should be clearly displayed, maybe parser is broken.
Screenshots
Version info:
Had an older version, updated to latest and same issue:
Originally:
Difftastic 0.69.0
Revision: 90a0f1b6a 2026-04-29 Toolchain: 1.95.0 System: linux x86_64
Updated to 0.70.0-2 and the problem persists!
Terminal info:
ghostty + bash
Additional context
Seems like some issue with whitespace parsing / or the tsx convention {" "} in place of . Funnily enough, if we change that multiline:
<span className="text-sm font-medium text-[var(--sea-ink-soft)]">
Tags
</span>to this:
<span className="text-sm font-medium text-[var(--sea-ink-soft)]">Tags</span>The diff works as expected.
Source: Wilfred/difftastic