diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-12-01 20:35:58 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-12-01 20:35:58 +0100 |
commit | 97ce419201421f65f4764549ed80307a7ef9c7a6 (patch) | |
tree | 0ba380c7872e3fed3b109a4af087b7c3b4417e73 /src/buffer.c | |
parent | 76bb7196f5102c9929959d710e8ed97a19affa4d (diff) | |
download | vim-git-97ce419201421f65f4764549ed80307a7ef9c7a6.tar.gz |
patch 8.0.1361: some users don't want to diff with hidden buffersv8.0.1361
Problem: Some users don't want to diff with hidden buffers.
Solution: Add the "hiddenoff" item to 'diffopt'. (Alisue, closes #2394)
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c index dad910388..ed5773e88 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -593,6 +593,11 @@ aucmd_abort: if (buf->b_nwindows > 0) --buf->b_nwindows; +#ifdef FEAT_DIFF + if (diffopt_hiddenoff() && !unload_buf && buf->b_nwindows == 0) + diff_buf_delete(buf); /* Clear 'diff' for hidden buffer. */ +#endif + /* Return when a window is displaying the buffer or when it's not * unloaded. */ if (buf->b_nwindows > 0 || !unload_buf) |