diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-06-08 10:13:04 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-06-08 10:13:04 +0200 |
commit | f85cbea725b4d21412dc0ddfd07239307b3b63a4 (patch) | |
tree | cb88d8d6a010490160b9f7d0b1a236d61d29b323 /src/nvim/buffer.c | |
parent | c500f22f3ced8bbc271c4ec50d2217626ba5e97e (diff) | |
parent | 2ca62239675b0c1e68b01aae1a0d45567b15e319 (diff) | |
download | rneovim-f85cbea725b4d21412dc0ddfd07239307b3b63a4.tar.gz rneovim-f85cbea725b4d21412dc0ddfd07239307b3b63a4.tar.bz2 rneovim-f85cbea725b4d21412dc0ddfd07239307b3b63a4.zip |
Merge #7917 'API: buffer updates'
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index ba63822837..838f267dcd 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -73,6 +73,7 @@ #include "nvim/os/os.h" #include "nvim/os/time.h" #include "nvim/os/input.h" +#include "nvim/buffer_updates.h" typedef enum { kBLSUnchanged = 0, @@ -574,6 +575,9 @@ void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last) /* Change directories when the 'acd' option is set. */ do_autochdir(); + // disable buffer updates for the current buffer + buf_updates_unregister_all(buf); + /* * Remove the buffer from the list. */ @@ -784,6 +788,8 @@ free_buffer_stuff ( map_clear_int(buf, MAP_ALL_MODES, true, true); // clear local abbrevs xfree(buf->b_start_fenc); buf->b_start_fenc = NULL; + + buf_updates_unregister_all(buf); } /* @@ -1732,9 +1738,11 @@ buf_T * buflist_new(char_u *ffname, char_u *sfname, linenr_T lnum, int flags) if (flags & BLN_DUMMY) buf->b_flags |= BF_DUMMY; buf_clear_file(buf); - clrallmarks(buf); /* clear marks */ - fmarks_check_names(buf); /* check file marks for this file */ - buf->b_p_bl = (flags & BLN_LISTED) ? TRUE : FALSE; /* init 'buflisted' */ + clrallmarks(buf); // clear marks + fmarks_check_names(buf); // check file marks for this file + buf->b_p_bl = (flags & BLN_LISTED) ? true : false; // init 'buflisted' + kv_destroy(buf->update_channels); + kv_init(buf->update_channels); if (!(flags & BLN_DUMMY)) { // Tricky: these autocommands may change the buffer list. They could also // split the window with re-using the one empty buffer. This may result in |