mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
get_keymap API (#6236)
* Add api function get keymap nvim_get_keymap(mode) nvim_buf_get_keymap(buffer, mode)
This commit is contained in:
@@ -453,6 +453,26 @@ Integer nvim_buf_get_changedtick(Buffer buffer, Error *err)
|
||||
return buf->b_changedtick;
|
||||
}
|
||||
|
||||
/// Get a list of dictionaries describing buffer-local mappings
|
||||
/// Note that the buffer key in the dictionary will represent the buffer
|
||||
/// handle where the mapping is present
|
||||
///
|
||||
/// @param mode The abbreviation for the mode
|
||||
/// @param buffer_id Buffer handle
|
||||
/// @param[out] err Error details, if any
|
||||
/// @returns An array of maparg() like dictionaries describing mappings
|
||||
ArrayOf(Dictionary) nvim_buf_get_keymap(Buffer buffer, String mode, Error *err)
|
||||
FUNC_API_SINCE(3)
|
||||
{
|
||||
buf_T *buf = find_buffer_by_handle(buffer, err);
|
||||
|
||||
if (!buf) {
|
||||
return (Array)ARRAY_DICT_INIT;
|
||||
}
|
||||
|
||||
return keymap_array(mode, buf);
|
||||
}
|
||||
|
||||
/// Sets a buffer-scoped (b:) variable
|
||||
///
|
||||
/// @param buffer Buffer handle
|
||||
|
Reference in New Issue
Block a user