mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
vim-patch:9.1.0740: incorrect internal diff with empty file (#30471)
Problem: incorrect internal diff with an empty file
Solution: Set pointer to NULL, instead of using an empty line file
(Yukihiro Nakadaira)
When using internal diff, empty file is read as one empty line file.
So result differs from external diff.
closes: vim/vim#15719
f1694b439b
Co-authored-by: Yukihiro Nakadaira <yukihiro.nakadaira@gmail.com>
This commit is contained in:
@@ -736,6 +736,12 @@ static void clear_diffout(diffout_T *dout)
|
||||
/// @return FAIL for failure.
|
||||
static int diff_write_buffer(buf_T *buf, mmfile_t *m, linenr_T start, linenr_T end)
|
||||
{
|
||||
if (buf->b_ml.ml_flags & ML_EMPTY) {
|
||||
m->ptr = NULL;
|
||||
m->size = 0;
|
||||
return OK;
|
||||
}
|
||||
|
||||
size_t len = 0;
|
||||
|
||||
if (end < 0) {
|
||||
|
Reference in New Issue
Block a user