neovim/test/functional/api
shadmansaleh b411f436d3 feat(api): add support for lua function & description in keymap
Behavioral changes:

1. Added support for lua function in keymaps in
--------------------------------------------
- nvim_set_keymap
  Can set lua function as keymap rhs like following:
```lua
vim.api.nvim_{buf_}set_keymap('n', '<leader>lr', '', {callback = vim.lsp.buf.references})
```
  Note: lua function can only be set from lua . If api function being
  called from viml or over rpc this option isn't available.
- nvim_{buf_}get_keymap
  When called from lua, lua function is returned is `callback` key .
  But in other cases callback contains number of the function ref.
- :umap, nvim_del_keymap & nvim_buf_del_keymap clears lua keymaps correctly.
- :map commands for displaing rhs .
   For lua keymaps rhs is displayed as <Lua function ref_no>
   Note: lua keymap cannot be set through viml command / functions.
- mapargs()
  When dict is false it returns string in `<Lua function ref_no>`
  format (same format as :map commands).
  When dict is true it returns ref_no number in `callback` key.
- mapcheck()
  returns string in `<Lua function ref_no>` format (same format as :map commands).

2. Added support for keymap description
---------------------------------------
- nvim_{buf_}set_keymap: added `desc` option in opts table .
 ```lua
vim.api.nvim_set_keymap('n', '<leader>w', '<cmd>w<cr>', {desc='Save current file'})
```
- nvim_{buf_}get_keymap: contains `desc` in returned list.
- commands like `:nmap <leader>w` will show description in a new line below rhs.
- `maparg()` return dict contains `desc`.
2022-01-01 00:26:58 +06:00
..
buffer_spec.lua feat(api): add nvim_get_option_value 2021-12-04 14:04:23 -07:00
buffer_updates_spec.lua test: update tests to work with 'hidden' 2021-08-18 12:17:12 -06:00
command_spec.lua feat(api): implement nvim_{add,del}_user_command 2021-12-28 14:08:44 -07:00
extmark_spec.lua test: remove references to misc1.c 2021-12-11 07:10:01 +08:00
highlight_spec.lua Improvements to tests 2021-04-22 17:09:18 +06:00
keymap_spec.lua feat(api): add support for lua function & description in keymap 2022-01-01 00:26:58 +06:00
menu_spec.lua tests/ui: remove unnecessary screen:detach() 2019-10-13 22:10:42 +02:00
proc_spec.lua doc + extmarks tweaks #11421 2019-11-25 01:08:02 -08:00
rpc_fixture.lua server_requests_spec: fix assertion, pass Lua paths via args (#10875) 2019-09-16 19:16:39 +02:00
server_notifications_spec.lua test(api): mark "notify cancels stale events on channel close" fragile 2021-11-30 22:27:34 -05:00
server_requests_spec.lua test: fix running functional tests under gdbserver 2021-09-20 18:10:40 +05:30
tabpage_spec.lua API: include invalid buffer/window/tabpage in error message (#11712) 2020-01-14 09:21:10 +01:00
ui_spec.lua UIEnter/UILeave: fire for embedder UI, builtin TUI 2019-09-12 17:04:05 -07:00
version_spec.lua test/api: verify that UI options from stable metadata are preserved 2018-12-21 10:52:25 +01:00
vim_spec.lua fix: do not save K_EVENT as lastc in Insert mode 2021-12-26 16:14:35 +08:00
window_spec.lua feat(api): add nvim_get_option_value 2021-12-04 14:04:23 -07:00