mirror of
https://github.com/neovim/neovim.git
synced 2025-12-02 06:53:05 +00:00
Merge pull request #17424 from zeertzjq/map-followup
follow-up PR to #17423
This commit is contained in:
@@ -1584,7 +1584,7 @@ nvim_set_keymap({mode}, {lhs}, {rhs}, {*opts}) *nvim_set_keymap()*
|
|||||||
{rhs} Right-hand-side |{rhs}| of the mapping.
|
{rhs} Right-hand-side |{rhs}| of the mapping.
|
||||||
{opts} Optional parameters map. Accepts all
|
{opts} Optional parameters map. Accepts all
|
||||||
|:map-arguments| as keys excluding |<buffer>| but
|
|:map-arguments| as keys excluding |<buffer>| but
|
||||||
including |noremap| and "desc". |desc| can be used
|
including |noremap| and "desc". "desc" can be used
|
||||||
to give a description to keymap. When called from
|
to give a description to keymap. When called from
|
||||||
Lua, also accepts a "callback" key that takes a
|
Lua, also accepts a "callback" key that takes a
|
||||||
Lua function to call when the mapping is executed.
|
Lua function to call when the mapping is executed.
|
||||||
|
|||||||
@@ -502,7 +502,9 @@ Note: When using mappings for Visual mode, you can use the "'<" mark, which
|
|||||||
is the start of the last selected Visual area in the current buffer |'<|.
|
is the start of the last selected Visual area in the current buffer |'<|.
|
||||||
|
|
||||||
The |:filter| command can be used to select what mappings to list. The
|
The |:filter| command can be used to select what mappings to list. The
|
||||||
pattern is matched against the {lhs}, {rhs} and {desc} in the raw form.
|
pattern is matched against the {lhs} and {rhs} in the raw form. If a
|
||||||
|
description was added using |nvim_set_keymap()| or |nvim_buf_set_keymap()|
|
||||||
|
then the pattern is also matched against it.
|
||||||
|
|
||||||
*:map-verbose*
|
*:map-verbose*
|
||||||
When 'verbose' is non-zero, listing a key map will also display where it was
|
When 'verbose' is non-zero, listing a key map will also display where it was
|
||||||
|
|||||||
@@ -1584,7 +1584,7 @@ ArrayOf(Dictionary) nvim_get_keymap(uint64_t channel_id, String mode)
|
|||||||
/// @param rhs Right-hand-side |{rhs}| of the mapping.
|
/// @param rhs Right-hand-side |{rhs}| of the mapping.
|
||||||
/// @param opts Optional parameters map. Accepts all |:map-arguments|
|
/// @param opts Optional parameters map. Accepts all |:map-arguments|
|
||||||
/// as keys excluding |<buffer>| but including |noremap| and "desc".
|
/// as keys excluding |<buffer>| but including |noremap| and "desc".
|
||||||
/// |desc| can be used to give a description to keymap.
|
/// "desc" can be used to give a description to keymap.
|
||||||
/// When called from Lua, also accepts a "callback" key that takes
|
/// When called from Lua, also accepts a "callback" key that takes
|
||||||
/// a Lua function to call when the mapping is executed.
|
/// a Lua function to call when the mapping is executed.
|
||||||
/// Values are Booleans. Unknown key is an error.
|
/// Values are Booleans. Unknown key is an error.
|
||||||
|
|||||||
@@ -3583,8 +3583,7 @@ int map_to_exists_mode(const char *const rhs, const int mode, const bool abbr)
|
|||||||
mp = maphash[hash];
|
mp = maphash[hash];
|
||||||
}
|
}
|
||||||
for (; mp; mp = mp->m_next) {
|
for (; mp; mp = mp->m_next) {
|
||||||
if ((mp->m_mode & mode)
|
if ((mp->m_mode & mode) && strstr((char *)mp->m_str, rhs) != NULL) {
|
||||||
&& mp->m_str != NULL && strstr((char *)mp->m_str, rhs) != NULL) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user