mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 9.1.1018: v9.1.0743 causes regression with diff mode
Problem: v9.1.0743 causes regression with diff mode Solution: Fix the regression with overlapping regions closes: #16454 Signed-off-by: Yukihiro Nakadaira <yukihiro.nakadaira@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
6472e58365
commit
01f6509fb2
10
src/diff.c
10
src/diff.c
@@ -1824,8 +1824,14 @@ diff_read(
|
||||
dp->df_count[idx_new] = hunk->count_new - off;
|
||||
}
|
||||
else
|
||||
{
|
||||
// second overlap of new block with existing block
|
||||
dp->df_count[idx_new] += hunk->count_new;
|
||||
if ((dp->df_lnum[idx_new] + dp->df_count[idx_new] - 1)
|
||||
> curtab->tp_diffbuf[idx_new]->b_ml.ml_line_count)
|
||||
dp->df_count[idx_new] = curtab->tp_diffbuf[idx_new]->b_ml.ml_line_count
|
||||
- dp->df_lnum[idx_new] + 1;
|
||||
}
|
||||
|
||||
// Adjust the size of the block to include all the lines to the
|
||||
// end of the existing block or the new diff, whatever ends last.
|
||||
@@ -1835,6 +1841,10 @@ diff_read(
|
||||
{
|
||||
// new change ends in existing block, adjust the end
|
||||
dp->df_count[idx_new] += -off;
|
||||
if ((dp->df_lnum[idx_new] + dp->df_count[idx_new] - 1)
|
||||
> curtab->tp_diffbuf[idx_new]->b_ml.ml_line_count)
|
||||
dp->df_count[idx_new] = curtab->tp_diffbuf[idx_new]->b_ml.ml_line_count
|
||||
- dp->df_lnum[idx_new] + 1;
|
||||
off = 0;
|
||||
}
|
||||
for (i = idx_orig; i < idx_new; ++i)
|
||||
|
Reference in New Issue
Block a user