api: allow nvim_buf_attach from lua using callbacks

This commit is contained in:
Björn Linse
2019-05-29 10:05:00 +02:00
parent 4841c46e33
commit f5c56f03bb
20 changed files with 301 additions and 59 deletions

View File

@@ -1836,6 +1836,8 @@ buf_T * buflist_new(char_u *ffname, char_u *sfname, linenr_T lnum, int flags)
buf->b_p_bl = (flags & BLN_LISTED) ? true : false; // init 'buflisted'
kv_destroy(buf->update_channels);
kv_init(buf->update_channels);
kv_destroy(buf->update_callbacks);
kv_init(buf->update_callbacks);
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