mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
feat(api): nvim_exec2(), deprecate nvim_exec() #19032
Problem: The signature of nvim_exec() is not extensible per ":help api-contract". Solution: Introduce nvim_exec2() and deprecate nvim_exec().
This commit is contained in:
committed by
GitHub
parent
257d894d75
commit
fe9cbcb3a5
@@ -96,12 +96,12 @@ describe(':source', function()
|
||||
let d = s:s]])
|
||||
|
||||
command('source')
|
||||
eq('2', meths.exec('echo a', true))
|
||||
eq("{'k': 'v'}", meths.exec('echo b', true))
|
||||
eq('2', meths.exec2('echo a', { output = true }).output)
|
||||
eq("{'k': 'v'}", meths.exec2('echo b', { output = true }).output)
|
||||
|
||||
-- Script items are created only on script var access
|
||||
eq("1", meths.exec('echo c', true))
|
||||
eq("0zBEEFCAFE", meths.exec('echo d', true))
|
||||
eq("1", meths.exec2('echo c', { output = true }).output)
|
||||
eq("0zBEEFCAFE", meths.exec2('echo d', { output = true }).output)
|
||||
|
||||
exec('set cpoptions+=C')
|
||||
eq('Vim(let):E723: Missing end of Dictionary \'}\': ', exc_exec('source'))
|
||||
@@ -124,14 +124,14 @@ describe(':source', function()
|
||||
-- Source the 2nd line only
|
||||
feed('ggjV')
|
||||
feed_command(':source')
|
||||
eq('3', meths.exec('echo a', true))
|
||||
eq('3', meths.exec2('echo a', { output = true }).output)
|
||||
|
||||
-- Source from 2nd line to end of file
|
||||
feed('ggjVG')
|
||||
feed_command(':source')
|
||||
eq('4', meths.exec('echo a', true))
|
||||
eq("{'K': 'V'}", meths.exec('echo b', true))
|
||||
eq("<SNR>1_C()", meths.exec('echo D()', true))
|
||||
eq('4', meths.exec2('echo a', { output = true }).output)
|
||||
eq("{'K': 'V'}", meths.exec2('echo b', { output = true }).output)
|
||||
eq("<SNR>1_C()", meths.exec2('echo D()', { output = true }).output)
|
||||
|
||||
-- Source last line only
|
||||
feed_command(':$source')
|
||||
@@ -147,7 +147,7 @@ describe(':source', function()
|
||||
let a = 123
|
||||
]]
|
||||
command('source')
|
||||
eq('123', meths.exec('echo a', true))
|
||||
eq('123', meths.exec2('echo a', { output = true }).output)
|
||||
end)
|
||||
|
||||
it('multiline heredoc command', function()
|
||||
@@ -157,7 +157,7 @@ describe(':source', function()
|
||||
EOF]])
|
||||
|
||||
command('source')
|
||||
eq('4', meths.exec('echo luaeval("y")', true))
|
||||
eq('4', meths.exec2('echo luaeval("y")', { output = true }).output)
|
||||
end)
|
||||
|
||||
it('can source lua files', function()
|
||||
|
||||
Reference in New Issue
Block a user