mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
fix(api): populate lhsrawalt in nvim_get_keymap response
Problem:
The `nvim_get_keymap()` function is missing the `lhsrawalt` field in its response for mappings with an alternate key representation. This makes its return value inconsistent with its documented `maparg()`-like structure and its formal type definition.
Solution:
Corrects the `keymap_array` function to pass the alternate mapping keys (`current_maphash->m_alt->m_keys`) to `mapblock_fill_dict`. The argument responsible for this was previously hardcoded to `NULL`.
For example, for a mapping of `<C-x>`, the API will now correctly return both `lhsraw` (`<80><fc>^DX`) and `lhsrawalt` (the alternate form, e.g., `^X`).
(cherry picked from commit d523750de0
)
This commit is contained in:
committed by
github-actions[bot]
parent
2d3a4154c5
commit
6889f9168b
@ -2894,7 +2894,10 @@ ArrayOf(Dict) keymap_array(String mode, buf_T *buf, Arena *arena)
|
||||
}
|
||||
// Check for correct mode
|
||||
if (int_mode & current_maphash->m_mode) {
|
||||
kvi_push(mappings, DICT_OBJ(mapblock_fill_dict(current_maphash, NULL, buffer_value,
|
||||
kvi_push(mappings, DICT_OBJ(mapblock_fill_dict(current_maphash,
|
||||
current_maphash->m_alt
|
||||
? current_maphash->m_alt->m_keys : NULL,
|
||||
buffer_value,
|
||||
is_abbrev, false, arena)));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user