comparison src/buffer.c @ 12971:ca3cb1997f08 v8.0.1361

patch 8.0.1361: some users don't want to diff with hidden buffers commit https://github.com/vim/vim/commit/97ce419201421f65f4764549ed80307a7ef9c7a6 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 1 20:35:58 2017 +0100 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 https://github.com/vim/vim/issues/2394)
author Christian Brabandt <cb@256bit.org>
date Fri, 01 Dec 2017 20:45:08 +0100
parents 185f8dbdcf26
children 197a08152ad5
comparison
equal deleted inserted replaced
12970:06d24dd1299b 12971:ca3cb1997f08
590 #endif 590 #endif
591 591
592 /* decrease the link count from windows (unless not in any window) */ 592 /* decrease the link count from windows (unless not in any window) */
593 if (buf->b_nwindows > 0) 593 if (buf->b_nwindows > 0)
594 --buf->b_nwindows; 594 --buf->b_nwindows;
595
596 #ifdef FEAT_DIFF
597 if (diffopt_hiddenoff() && !unload_buf && buf->b_nwindows == 0)
598 diff_buf_delete(buf); /* Clear 'diff' for hidden buffer. */
599 #endif
595 600
596 /* Return when a window is displaying the buffer or when it's not 601 /* Return when a window is displaying the buffer or when it's not
597 * unloaded. */ 602 * unloaded. */
598 if (buf->b_nwindows > 0 || !unload_buf) 603 if (buf->b_nwindows > 0 || !unload_buf)
599 return; 604 return;