small fixes

pull/94/head
Timothée Sterle 2 years ago
parent 5f18514d21
commit f161c5ea5b
No known key found for this signature in database
GPG Key ID: 136D558122196ED5

@ -433,7 +433,7 @@ put({1, 2, 3})
```
Alternatively, you can use the `:lua` command to pretty-print a Lua expression by prefixing it with `=` (Neovim 0.7+ only):
```lua
```vim
:lua =vim.loop
```
@ -1006,6 +1006,8 @@ echo s:list
" [2, 4, 6]
echo s:newlist
" [2, 4, 6]
echo s:list is# s:newlist
" 1
```
Using this function from Lua creates a copy instead:
@ -1016,6 +1018,7 @@ local newtbl = vim.fn.map(tbl, function(_, v) return v * 2 end)
print(vim.inspect(tbl)) -- { 1, 2, 3 }
print(vim.inspect(newtbl)) -- { 2, 4, 6 }
print(tbl == newtbl) -- false
```
#### Conversion is not always possible
@ -1039,7 +1042,7 @@ print(vim.g.test_dict.test_lambda) -- nil
print(vim.inspect(vim.g.test_dict)) -- {}
```
Passing Lua functions to Vim functions is OK, storing them in Vim variables is not:
Passing Lua functions to Vim functions is OK, storing them in Vim variables is not (fixed in Neovim 0.7.0+):
```lua
-- This works:

@ -1228,6 +1228,8 @@ in place:
" [2, 4, 6]
echo s:newlist
" [2, 4, 6]
echo s:list is# s:newlist
" 1
<
Using this function from Lua creates a copy instead:
@ -1238,6 +1240,7 @@ Using this function from Lua creates a copy instead:
print(vim.inspect(tbl)) -- { 1, 2, 3 }
print(vim.inspect(newtbl)) -- { 2, 4, 6 }
print(tbl == newtbl) -- false
<
Conversion is not always possible~
@ -1265,7 +1268,7 @@ references to them. This can cause surprising behaviors:
<
Passing Lua functions to Vim functions is OK, storing them in Vim
variables is not:
variables is not (fixed in Neovim 0.7.0+):
>
-- This works:

Loading…
Cancel
Save