vim-patch:8.0.1361: some users don't want to diff with hidden buffers

Problem:    Some users don't want to diff with hidden buffers.
Solution:   Add the "hiddenoff" item to 'diffopt'. (Alisue, closes vim/vim#2394)
97ce419201
This commit is contained in:
Jan Edmund Lazo
2018-08-11 14:55:02 -04:00
parent 90128843f6
commit 594536a1e7
4 changed files with 40 additions and 0 deletions

View File

@@ -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)