|
|
@ -635,6 +635,12 @@ print(vim.call('printf', 'Hello from %s', 'Lua'))
|
|
|
|
local reversed_list = vim.call('reverse', { 'a', 'b', 'c' })
|
|
|
|
local reversed_list = vim.call('reverse', { 'a', 'b', 'c' })
|
|
|
|
print(vim.inspect(reversed_list)) -- { "c", "b", "a" }
|
|
|
|
print(vim.inspect(reversed_list)) -- { "c", "b", "a" }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local function print_stdout(chan_id, data, name)
|
|
|
|
|
|
|
|
print(data[1])
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vim.call('jobstart', 'ls', { on_stdout = print_stdout })
|
|
|
|
|
|
|
|
|
|
|
|
vim.call('my#autoload#function')
|
|
|
|
vim.call('my#autoload#function')
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
@ -650,6 +656,12 @@ print(vim.fn.printf('Hello from %s', 'Lua'))
|
|
|
|
|
|
|
|
|
|
|
|
local reversed_list = vim.fn.reverse({ 'a', 'b', 'c' })
|
|
|
|
local reversed_list = vim.fn.reverse({ 'a', 'b', 'c' })
|
|
|
|
print(vim.inspect(reversed_list)) -- { "c", "b", "a" }
|
|
|
|
print(vim.inspect(reversed_list)) -- { "c", "b", "a" }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local function print_stdout(chan_id, data, name)
|
|
|
|
|
|
|
|
print(data[1])
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vim.fn.jobstart('ls', { on_stdout = print_stdout })
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Hashes `#` aren't valid characters for indentifiers in Lua, so autoload functions have to be called with this syntax:
|
|
|
|
Hashes `#` aren't valid characters for indentifiers in Lua, so autoload functions have to be called with this syntax:
|
|
|
|