Fix stale hunks after commit (#24663)
Fixes a regression introduced in #24475. Release Notes: - N/A
This commit is contained in:
parent
bbea3a2184
commit
6e7416eb00
2 changed files with 9 additions and 14 deletions
|
@ -260,15 +260,12 @@ impl BufferDiffState {
|
|||
let changed_range = match (unstaged_changed_range, uncommitted_changed_range) {
|
||||
(None, None) => None,
|
||||
(Some(unstaged_range), None) => {
|
||||
uncommitted_diff.range_to_hunk_range(unstaged_range, &buffer, cx)
|
||||
Some(uncommitted_diff.range_to_hunk_range(unstaged_range, &buffer, cx))
|
||||
}
|
||||
(None, Some(uncommitted_range)) => Some(uncommitted_range),
|
||||
(Some(unstaged_range), Some(uncommitted_range)) => maybe!({
|
||||
let expanded_range = uncommitted_diff.range_to_hunk_range(
|
||||
unstaged_range,
|
||||
&buffer,
|
||||
cx,
|
||||
)?;
|
||||
let expanded_range =
|
||||
uncommitted_diff.range_to_hunk_range(unstaged_range, &buffer, cx);
|
||||
let start = expanded_range.start.min(&uncommitted_range.start, &buffer);
|
||||
let end = expanded_range.end.max(&uncommitted_range.end, &buffer);
|
||||
Some(start..end)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue