aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/diff.c
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-09-30 12:09:36 +0100
committerGitHub <noreply@github.com>2024-09-30 12:09:36 +0100
commit2c88cfcac42d0a4e0b1a1396539b5add807c336c (patch)
tree0301447a10df4021c0157e5e96738f4a6adbcc0d /src/nvim/diff.c
parent20251be15a4ad3f6e7016450ca3338d52b2f0951 (diff)
parent0fb5299e53cc0d7a5c03c333b1ed79262a0db3f9 (diff)
downloadrneovim-2c88cfcac42d0a4e0b1a1396539b5add807c336c.tar.gz
rneovim-2c88cfcac42d0a4e0b1a1396539b5add807c336c.tar.bz2
rneovim-2c88cfcac42d0a4e0b1a1396539b5add807c336c.zip
Merge pull request #30526 from lewis6991/fix/linematchnul
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r--src/nvim/diff.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index 05e5bed50c..d22fb65827 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -2005,7 +2005,7 @@ static void run_linematch_algorithm(diff_T *dp)
{
// define buffers for diff algorithm
mmfile_t diffbufs_mm[DB_COUNT];
- const char *diffbufs[DB_COUNT];
+ const mmfile_t *diffbufs[DB_COUNT];
int diff_length[DB_COUNT];
size_t ndiffs = 0;
for (int i = 0; i < DB_COUNT; i++) {
@@ -2015,9 +2015,7 @@ static void run_linematch_algorithm(diff_T *dp)
diff_write_buffer(curtab->tp_diffbuf[i], &diffbufs_mm[ndiffs],
dp->df_lnum[i], dp->df_lnum[i] + dp->df_count[i] - 1);
- // we want to get the char* to the diff buffer that was just written
- // we add it to the array of char*, diffbufs
- diffbufs[ndiffs] = diffbufs_mm[ndiffs].ptr;
+ diffbufs[ndiffs] = &diffbufs_mm[ndiffs];
// keep track of the length of this diff block to pass it to the linematch
// algorithm