diff options
author | Shadman <13149513+shadmansaleh@users.noreply.github.com> | 2022-02-16 14:39:50 +0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-16 16:39:50 +0800 |
commit | 9a74c2b04ac8f54a17925a437b5a2f03b18f6281 (patch) | |
tree | 7d2dc0766e3c7e99646a9db56f8f505fb579f27e /test | |
parent | deb33a9775f53d2b32aeeb1825e773bccb039ca4 (diff) | |
download | rneovim-9a74c2b04ac8f54a17925a437b5a2f03b18f6281.tar.gz rneovim-9a74c2b04ac8f54a17925a437b5a2f03b18f6281.tar.bz2 rneovim-9a74c2b04ac8f54a17925a437b5a2f03b18f6281.zip |
feat(mappings): considering map description when filtering (#17423)
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/api/keymap_spec.lua | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/test/functional/api/keymap_spec.lua b/test/functional/api/keymap_spec.lua index 06b699193a..e49e0b8cc4 100644 --- a/test/functional/api/keymap_spec.lua +++ b/test/functional/api/keymap_spec.lua @@ -877,6 +877,24 @@ describe('nvim_set_keymap, nvim_del_keymap', function() eq("\nn lhs rhs\n map description", helpers.exec_capture("nmap lhs")) end) + + it ('can :filter maps based on description', function() + meths.set_keymap('n', 'asdf1', 'qwert', {desc='do the one thing'}) + meths.set_keymap('n', 'asdf2', 'qwert', {desc='doesnot really do anything'}) + meths.set_keymap('n', 'asdf3', 'qwert', {desc='do the other thing'}) + eq([[ + +n asdf3 qwert + do the other thing +n asdf1 qwert + do the one thing]], + helpers.exec_capture('filter the nmap')) + 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) describe('nvim_buf_set_keymap, nvim_buf_del_keymap', function() @@ -1037,9 +1055,4 @@ describe('nvim_buf_set_keymap, nvim_buf_del_keymap', function() eq(1, exec_lua[[return GlobalCount]]) eq('\nNo mapping found', helpers.exec_capture('nmap asdf')) 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) |