mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
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:
@@ -1459,6 +1459,9 @@ void nvim_chan_send(Integer chan, String data, Error *err)
|
||||
/// By default `FloatBorder` highlight is used which links to `VertSplit`
|
||||
/// when not defined. It could also be specified by character:
|
||||
/// [ {"+", "MyCorner"}, {"x", "MyBorder"} ]
|
||||
/// - `noautocmd`: If true then no buffer-related autocommand events such as
|
||||
/// |BufEnter|, |BufLeave| or |BufWinEnter| may fire from
|
||||
/// calling this function.
|
||||
///
|
||||
/// @param[out] err Error details, if any
|
||||
///
|
||||
@@ -1469,7 +1472,7 @@ Window nvim_open_win(Buffer buffer, Boolean enter, Dictionary config,
|
||||
FUNC_API_CHECK_TEXTLOCK
|
||||
{
|
||||
FloatConfig fconfig = FLOAT_CONFIG_INIT;
|
||||
if (!parse_float_config(config, &fconfig, false, err)) {
|
||||
if (!parse_float_config(config, &fconfig, false, true, err)) {
|
||||
return 0;
|
||||
}
|
||||
win_T *wp = win_new_float(NULL, fconfig, err);
|
||||
@@ -1484,7 +1487,7 @@ Window nvim_open_win(Buffer buffer, Boolean enter, Dictionary config,
|
||||
return 0;
|
||||
}
|
||||
if (buffer > 0) {
|
||||
nvim_win_set_buf(wp->handle, buffer, err);
|
||||
win_set_buf(wp->handle, buffer, fconfig.noautocmd, err);
|
||||
}
|
||||
|
||||
if (fconfig.style == kWinStyleMinimal) {
|
||||
|
Reference in New Issue
Block a user