diff options
author | Lewis Russell <lewis6991@gmail.com> | 2022-11-05 00:58:01 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-05 00:58:01 +0000 |
commit | 95f2f3cb5efcc18f17f2812ba6d1d9e1c06b2b5a (patch) | |
tree | e36b2714130be2ccd047a5f60d0afb9a45c84126 | |
parent | 234b8c5f3d57294dda06dbc6c1760e5983bd2c19 (diff) | |
download | rneovim-95f2f3cb5efcc18f17f2812ba6d1d9e1c06b2b5a.tar.gz rneovim-95f2f3cb5efcc18f17f2812ba6d1d9e1c06b2b5a.tar.bz2 rneovim-95f2f3cb5efcc18f17f2812ba6d1d9e1c06b2b5a.zip |
fix(vim.diff): fix fastforward off-by-1 (#20937)
-rw-r--r-- | src/nvim/lua/xdiff.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/lua/xdiff.c b/src/nvim/lua/xdiff.c index 3adb6088fc..cd542b0e00 100644 --- a/src/nvim/lua/xdiff.c +++ b/src/nvim/lua/xdiff.c @@ -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); |