api(nvim_open_win): add "noautocmd" option

This option, when set, stops nvim_open_win() from potentially firing
buffer-related autocmd events
(BufEnter, BufLeave and BufWinEnter in the case of nvim_open_win()).
This commit is contained in:
Sean Dewar
2021-05-27 22:10:42 +01:00
parent 27c616d688
commit 802f8429d5
6 changed files with 71 additions and 35 deletions

View File

@@ -1090,6 +1090,7 @@ typedef struct {
schar_T border_chars[8];
int border_hl_ids[8];
int border_attr[8];
bool noautocmd;
} FloatConfig;
#define FLOAT_CONFIG_INIT ((FloatConfig){ .height = 0, .width = 0, \
@@ -1098,7 +1099,8 @@ typedef struct {
.relative = 0, .external = false, \
.focusable = true, \
.zindex = kZIndexFloatDefault, \
.style = kWinStyleUnused })
.style = kWinStyleUnused, \
.noautocmd = false })
// Structure to store last cursor position and topline. Used by check_lnums()
// and reset_lnums().