diff options
author | Daniel Hahler <github@thequod.de> | 2017-06-11 15:03:02 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-06-11 15:03:02 +0200 |
commit | d0ff2000b2a639f3bb0f70e37104b561dab05562 (patch) | |
tree | 737835f61cc74bee9fa9594751e6db321bc9d591 /src/nvim/api | |
parent | 90f20bd7b17a4c6889136008593312f8f8fe377b (diff) | |
download | rneovim-d0ff2000b2a639f3bb0f70e37104b561dab05562.tar.gz rneovim-d0ff2000b2a639f3bb0f70e37104b561dab05562.tar.bz2 rneovim-d0ff2000b2a639f3bb0f70e37104b561dab05562.zip |
vim-patch:8.0.0607 (#6879)
Problem: When creating a bufref, then using :bwipe and :new it might get
the same memory and bufref_valid() returns true.
Solution: Add br_fnum to check the buffer number didn't change.
https://github.com/vim/vim/commit/45e5fd135da5710f24a1acc142692f120f8b0b78
Diffstat (limited to 'src/nvim/api')
-rw-r--r-- | src/nvim/api/buffer.c | 2 | ||||
-rw-r--r-- | src/nvim/api/private/helpers.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 5c2e968864..94554bc4c1 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -330,7 +330,7 @@ void nvim_buf_set_lines(uint64_t channel_id, } try_start(); - bufref_T save_curbuf = { NULL, 0 }; + bufref_T save_curbuf = { NULL, 0, 0 }; switch_to_win_for_buf(buf, &save_curwin, &save_curtab, &save_curbuf); if (u_save((linenr_T)(start - 1), (linenr_T)end) == FAIL) { diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index ef789b3ed4..d401ae52a0 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -961,7 +961,7 @@ static void set_option_value_for(char *key, { win_T *save_curwin = NULL; tabpage_T *save_curtab = NULL; - bufref_T save_curbuf = { NULL, 0 }; + bufref_T save_curbuf = { NULL, 0, 0 }; try_start(); switch (opt_type) |