mirror of
https://github.com/neovim/neovim.git
synced 2025-09-26 21:18:34 +00:00
fix: <Nop> not shown in :map commands
This commit is contained in:
@@ -3483,7 +3483,7 @@ static void showmap(mapblock_T *mp, bool local)
|
|||||||
char msg[100];
|
char msg[100];
|
||||||
snprintf(msg, sizeof(msg), "<Lua function %d>", mp->m_luaref);
|
snprintf(msg, sizeof(msg), "<Lua function %d>", mp->m_luaref);
|
||||||
msg_puts_attr(msg, HL_ATTR(HLF_8));
|
msg_puts_attr(msg, HL_ATTR(HLF_8));
|
||||||
} else if (mp->m_str == NULL) {
|
} else if (mp->m_str[0] == NUL) {
|
||||||
msg_puts_attr("<Nop>", HL_ATTR(HLF_8));
|
msg_puts_attr("<Nop>", HL_ATTR(HLF_8));
|
||||||
} else {
|
} else {
|
||||||
// Remove escaping of K_SPECIAL, because "m_str" is in a format to be used
|
// Remove escaping of K_SPECIAL, because "m_str" is in a format to be used
|
||||||
|
@@ -1037,4 +1037,9 @@ describe('nvim_buf_set_keymap, nvim_buf_del_keymap', function()
|
|||||||
eq(1, exec_lua[[return GlobalCount]])
|
eq(1, exec_lua[[return GlobalCount]])
|
||||||
eq('\nNo mapping found', helpers.exec_capture('nmap asdf'))
|
eq('\nNo mapping found', helpers.exec_capture('nmap asdf'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it ('shows <nop> as map rhs', function()
|
||||||
|
meths.set_keymap('n', 'asdf', '<nop>', {})
|
||||||
|
eq('\nn asdf <Nop>', helpers.exec_capture('nmap asdf'))
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user