remove todos

`nvim_exec` now supports script scope
This commit is contained in:
Timothée Sterle 2021-10-17 17:06:52 +02:00
parent 56697b5c65
commit c418303b27
No known key found for this signature in database
GPG Key ID: 136D558122196ED5
2 changed files with 6 additions and 17 deletions

View File

@ -449,8 +449,6 @@ print(vim.api.nvim_eval('v:true')) -- true
print(vim.api.nvim_eval('v:null')) -- nil
```
**TODO**: is it possible for `vim.api.nvim_eval()` to return a `funcref`?
#### Caveats
Unlike `luaeval()`, `vim.api.nvim_eval()` does not provide an implicit `_A` variable to pass data to the expression.
@ -462,21 +460,19 @@ This function evaluates a chunk of Vimscript code. It takes in a string containi
```lua
local result = vim.api.nvim_exec(
[[
let mytext = 'hello world'
let s:mytext = 'hello world'
function! MyFunction(text)
function! s:MyFunction(text)
echo a:text
endfunction
call MyFunction(mytext)
call s:MyFunction(s:mytext)
]],
true)
print(result) -- 'hello world'
```
**TODO**: the docs say that script-scope (`s:`) is supported, but running this snippet with a script-scoped variable throws an error. Why?
### vim.api.nvim_command()
This function executes an ex command. It takes in a string containing the command to execute.

View File

@ -553,9 +553,6 @@ It is the Lua equivalent of the `luaeval()` function in Vimscript
print(vim.api.nvim_eval('v:null')) -- nil
<
*Todo is it possible for `vim.api.nvim_eval()` to return a
`funcref`?
Caveats~
Unlike `luaeval()`, `vim.api.nvim_eval()` does not provide an implicit
@ -571,23 +568,19 @@ store the output in a variable, for example).
>
local result = vim.api.nvim_exec(
[[
let mytext = 'hello world'
let s:mytext = 'hello world'
function! MyFunction(text)
function! s:MyFunction(text)
echo a:text
endfunction
call MyFunction(mytext)
call s:MyFunction(s:mytext)
]],
true)
print(result) -- 'hello world'
<
*Todo the docs say that script-scope (`s:`) is supported,
but running this snippet with a script-scoped variable throws
an error. Why?
vim.api.nvim_command()~
This function executes an ex command. It takes in a string containing