Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
add note about nvim_call_function
Browse files Browse the repository at this point in the history
  • Loading branch information
nanotee committed Apr 4, 2021
1 parent 9f9aea1 commit 1561654
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,8 @@ vim.fn['my#autoload#function']()

The functionality of `vim.fn` is identical to `vim.call`, but allows a more Lua-like syntax.

It is distinct from `vim.api.nvim_call_function` in that converting Vim/Lua objects is automatic: `vim.api.nvim_call_function` returns a table for floating point numbers and does not accept Lua closures while `vim.fn` handles these types transparently.

See also:
- `:help vim.fn`

Expand Down
5 changes: 5 additions & 0 deletions doc/nvim-lua-guide.txt
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,11 @@ Lua, so autoload functions have to be called with this syntax:
The functionality of `vim.fn` is identical to `vim.call`, but allows a
more Lua-like syntax.

It is distinct from `vim.api.nvim_call_function` in that converting
Vim/Lua objects is automatic: `vim.api.nvim_call_function` returns a
table for floating point numbers and does not accept Lua closures while
`vim.fn` handles these types transparently.

See also:
- |vim.fn|

Expand Down

0 comments on commit 1561654

Please sign in to comment.