fix(vim.diff): fix fastforward off-by-1 (#20937)

This commit is contained in:
Lewis Russell 2022-11-05 00:58:01 +00:00 committed by GitHub
parent 234b8c5f3d
commit 95f2f3cb5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,8 +69,8 @@ static void get_linematch_results(lua_State *lstate, mmfile_t *ma, mmfile_t *mb,
const char *diff_begin[2] = { ma->ptr, mb->ptr };
int diff_length[2] = { (int)count_a, (int)count_b };
fastforward_buf_to_lnum(&diff_begin[0], start_a);
fastforward_buf_to_lnum(&diff_begin[1], start_b);
fastforward_buf_to_lnum(&diff_begin[0], start_a + 1);
fastforward_buf_to_lnum(&diff_begin[1], start_b + 1);
int *decisions = NULL;
size_t decisions_length = linematch_nbuffers(diff_begin, diff_length, 2, &decisions, iwhite);