diff options
author | ZyX <kp-pav@yandex.ru> | 2015-11-23 15:12:08 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2015-11-23 15:12:08 +0300 |
commit | ec8e60a055d75d7c78242957c87f574e360273a2 (patch) | |
tree | 1371e5f5ee042d5066dc99651136a55a1f3f086b /src | |
parent | 321db59ca1dc304feb3e00c10ca3e89c1de616e7 (diff) | |
download | rneovim-ec8e60a055d75d7c78242957c87f574e360273a2.tar.gz rneovim-ec8e60a055d75d7c78242957c87f574e360273a2.tar.bz2 rneovim-ec8e60a055d75d7c78242957c87f574e360273a2.zip |
shada: Do not save unlisted and quickfix buffers
Fixes #3635
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/shada.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nvim/shada.c b/src/nvim/shada.c index f8643fe655..11dfeea212 100644 --- a/src/nvim/shada.c +++ b/src/nvim/shada.c @@ -43,6 +43,7 @@ #include "nvim/path.h" #include "nvim/fileio.h" #include "nvim/strings.h" +#include "nvim/quickfix.h" #include "nvim/lib/khash.h" #include "nvim/lib/kvec.h" @@ -2478,8 +2479,11 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer, // Write buffer list if (find_shada_parameter('%') != NULL) { size_t buf_count = 0; +#define IGNORE_BUF(buf)\ + (buf->b_ffname == NULL || !buf->b_p_bl || bt_quickfix(buf) \ + || in_bufset(&removable_bufs, buf)) FOR_ALL_BUFFERS(buf) { - if (buf->b_ffname != NULL && !in_bufset(&removable_bufs, buf)) { + if (!IGNORE_BUF(buf)) { buf_count++; } } @@ -2497,7 +2501,7 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer, }; size_t i = 0; FOR_ALL_BUFFERS(buf) { - if (buf->b_ffname == NULL || in_bufset(&removable_bufs, buf)) { + if (IGNORE_BUF(buf)) { continue; } buflist_entry.data.buffer_list.buffers[i] = (struct buffer_list_buffer) { @@ -2513,6 +2517,7 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer, goto shada_write_exit; } xfree(buflist_entry.data.buffer_list.buffers); +#undef IGNORE_BUF } // Write some of the variables |