cmdline: CmdlineEnter and CmdlineLeave autocommands (#7422)

vim-patch:fafcf0dd59fd

patch 8.0.1206: no autocmd for entering or leaving the command line

Problem:    No autocmd for entering or leaving the command line.
Solution:   Add CmdlineEnter and CmdlineLeave.

fafcf0dd59
This commit is contained in:
Björn Linse
2017-11-22 22:35:20 +01:00
committed by GitHub
parent 9393be477a
commit a4f6cec7a3
10 changed files with 256 additions and 5 deletions

View File

@@ -1374,6 +1374,29 @@ int tv_dict_add_nr(dict_T *const d, const char *const key,
return OK;
}
/// Add a special entry to dictionary
///
/// @param[out] d Dictionary to add entry to.
/// @param[in] key Key to add.
/// @param[in] key_len Key length.
/// @param[in] val SpecialVarValue to add.
///
/// @return OK in case of success, FAIL when key already exists.
int tv_dict_add_special(dict_T *const d, const char *const key,
const size_t key_len, SpecialVarValue val)
{
dictitem_T *const item = tv_dict_item_alloc_len(key, key_len);
item->di_tv.v_lock = VAR_UNLOCKED;
item->di_tv.v_type = VAR_SPECIAL;
item->di_tv.vval.v_special = val;
if (tv_dict_add(d, item) == FAIL) {
tv_dict_item_free(item);
return FAIL;
}
return OK;
}
/// Add a string entry to dictionary
///
/// @param[out] d Dictionary to add entry to.