mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 10:31:48 +00:00
feat(api): rename buffer to buf in retval #38900
In3a4a66017b,4d3a67cd62we renamed "buffer" to "buf" in dict parameters. This commit also renames such keys in dict return-values.
This commit is contained in:
@@ -73,7 +73,7 @@ static int64_t next_autocmd_id = 1;
|
||||
/// - id: (`integer?`) Autocommand ID to match.
|
||||
/// - pattern: (`string|table?`) Pattern(s) to match |autocmd-pattern|. Not allowed with {buf}.
|
||||
/// @return Array of matching autocommands, where each item has:
|
||||
/// - buffer (`integer?`): Buffer id (only for |autocmd-buffer-local|).
|
||||
/// - buf (`integer?`): Buffer id (only for |autocmd-buffer-local|).
|
||||
/// - buflocal (`boolean?`): true if the autocommand is buffer-local |autocmd-buffer-local|.
|
||||
/// - callback: (`function|string?`): Event handler: a Lua function or Vimscript function name.
|
||||
/// - command: (`string`) Event handler: an Ex-command. Empty if a `callback` is set.
|
||||
@@ -277,7 +277,7 @@ ArrayOf(DictAs(get_autocmds__ret)) nvim_get_autocmds(Dict(get_autocmds) *opts, A
|
||||
}
|
||||
}
|
||||
|
||||
Dict autocmd_info = arena_dict(arena, 11);
|
||||
Dict autocmd_info = arena_dict(arena, 12);
|
||||
|
||||
if (ap->group != AUGROUP_DEFAULT) {
|
||||
PUT_C(autocmd_info, "group", INTEGER_OBJ(ap->group));
|
||||
@@ -319,6 +319,7 @@ ArrayOf(DictAs(get_autocmds__ret)) nvim_get_autocmds(Dict(get_autocmds) *opts, A
|
||||
|
||||
if (ap->buflocal_nr) {
|
||||
PUT_C(autocmd_info, "buflocal", BOOLEAN_OBJ(true));
|
||||
PUT_C(autocmd_info, "buf", INTEGER_OBJ(ap->buflocal_nr));
|
||||
PUT_C(autocmd_info, "buffer", INTEGER_OBJ(ap->buflocal_nr));
|
||||
} else {
|
||||
PUT_C(autocmd_info, "buflocal", BOOLEAN_OBJ(false));
|
||||
|
||||
@@ -855,7 +855,7 @@ Integer nvim_buf_get_changedtick(Buffer buffer, Error *err)
|
||||
/// @param mode Mode short-name ("n", "i", "v", ...)
|
||||
/// @param[out] err Error details, if any
|
||||
/// @returns Array of |maparg()|-like dictionaries describing mappings.
|
||||
/// The "buffer" key holds the associated buffer id.
|
||||
/// The "buf" key holds the associated buffer id.
|
||||
ArrayOf(DictAs(get_keymap)) nvim_buf_get_keymap(Buffer buffer, String mode, Arena *arena,
|
||||
Error *err)
|
||||
FUNC_API_SINCE(3)
|
||||
|
||||
@@ -1585,7 +1585,7 @@ DictAs(get_mode) nvim_get_mode(Arena *arena)
|
||||
///
|
||||
/// @param mode Mode short-name ("n", "i", "v", ...)
|
||||
/// @returns Array of |maparg()|-like dictionaries describing mappings.
|
||||
/// The "buffer" key is always zero.
|
||||
/// The "buf" key is always zero.
|
||||
ArrayOf(DictAs(get_keymap)) nvim_get_keymap(String mode, Arena *arena)
|
||||
FUNC_API_SINCE(3)
|
||||
{
|
||||
@@ -1781,7 +1781,8 @@ void nvim__chan_set_detach(uint64_t channel_id, Boolean detach, Error *err)
|
||||
/// - "pty" (optional) Name of pseudoterminal. On a POSIX system this is a device path like
|
||||
/// "/dev/pts/1". If unknown, the key will still be present if a pty is used (e.g.
|
||||
/// for conpty on Windows).
|
||||
/// - "buffer" (optional) Buffer connected to |terminal| instance.
|
||||
/// - "buf" (optional) Buffer connected to |terminal| instance.
|
||||
/// - "buffer" (optional) Deprecated alias for `buf`.
|
||||
/// - "client" (optional) Info about the peer (client on the other end of the channel), as set
|
||||
/// by |nvim_set_client_info()|.
|
||||
/// - "exitcode" (optional) Exit code of the |terminal| process.
|
||||
|
||||
@@ -999,7 +999,7 @@ Dict channel_info(uint64_t id, Arena *arena)
|
||||
return (Dict)ARRAY_DICT_INIT;
|
||||
}
|
||||
|
||||
Dict info = arena_dict(arena, 8);
|
||||
Dict info = arena_dict(arena, 9);
|
||||
PUT_C(info, "id", INTEGER_OBJ((Integer)chan->id));
|
||||
|
||||
const char *stream_desc, *mode_desc;
|
||||
@@ -1048,6 +1048,7 @@ Dict channel_info(uint64_t id, Arena *arena)
|
||||
PUT_C(info, "client", DICT_OBJ(chan->rpc.info));
|
||||
} else if (chan->term) {
|
||||
mode_desc = "terminal";
|
||||
PUT_C(info, "buf", BUFFER_OBJ(terminal_buf(chan->term)));
|
||||
PUT_C(info, "buffer", BUFFER_OBJ(terminal_buf(chan->term)));
|
||||
PUT_C(info, "exitcode", INTEGER_OBJ(chan->exit_status));
|
||||
} else {
|
||||
|
||||
@@ -2086,7 +2086,7 @@ static Dict mapblock_fill_dict(const mapblock_T *const mp, const char *lhsrawalt
|
||||
Arena *arena)
|
||||
FUNC_ATTR_NONNULL_ARG(1)
|
||||
{
|
||||
Dict dict = arena_dict(arena, 19);
|
||||
Dict dict = arena_dict(arena, 20);
|
||||
char *const lhs = str2special_arena(mp->m_keys, compatible, !compatible, arena);
|
||||
char *mapmode = arena_alloc(arena, 7, false);
|
||||
map_mode_to_chars(mp->m_mode, mapmode);
|
||||
@@ -2127,6 +2127,9 @@ static Dict mapblock_fill_dict(const mapblock_T *const mp, const char *lhsrawalt
|
||||
PUT_C(dict, "scriptversion", INTEGER_OBJ(1));
|
||||
PUT_C(dict, "lnum", INTEGER_OBJ(mp->m_script_ctx.sc_lnum));
|
||||
PUT_C(dict, "buffer", INTEGER_OBJ(buffer_value));
|
||||
if (!compatible) {
|
||||
PUT_C(dict, "buf", INTEGER_OBJ(buffer_value));
|
||||
}
|
||||
PUT_C(dict, "nowait", INTEGER_OBJ(mp->m_nowait ? 1 : 0));
|
||||
PUT_C(dict, "replace_keycodes", INTEGER_OBJ(mp->m_replace_keycodes ? 1 : 0));
|
||||
PUT_C(dict, "mode", CSTR_AS_OBJ(mapmode));
|
||||
|
||||
Reference in New Issue
Block a user