aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 71e04ec0fb..d4e21d26f6 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -509,6 +509,10 @@ void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last)
if (buf->b_nwindows > 0)
--buf->b_nwindows;
+ if (diffopt_hiddenoff() && !unload_buf && buf->b_nwindows == 0) {
+ diff_buf_delete(buf); // Clear 'diff' for hidden buffer.
+ }
+
/* Return when a window is displaying the buffer or when it's not
* unloaded. */
if (buf->b_nwindows > 0 || !unload_buf)