mirror of
https://github.com/neovim/neovim.git
synced 2025-12-08 07:32:40 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user