mirror of
https://github.com/neovim/neovim.git
synced 2026-05-24 05:40:08 +00:00
refactor(test): drop deprecated exc_exec #39242
This commit is contained in:
@@ -9,6 +9,7 @@ local SocketStream = uv_stream.SocketStream
|
||||
local ProcStream = uv_stream.ProcStream
|
||||
|
||||
local check_cores = t.check_cores
|
||||
local pcall_err = t.pcall_err
|
||||
local check_logs = t.check_logs
|
||||
local dedent = t.dedent
|
||||
local eq = t.eq
|
||||
@@ -864,20 +865,6 @@ function M.rmdir(path)
|
||||
end
|
||||
end
|
||||
|
||||
--- @deprecated Use `t.pcall_err()` to check failure, or `n.command()` to check success.
|
||||
function M.exc_exec(cmd)
|
||||
M.command(([[
|
||||
try
|
||||
execute "%s"
|
||||
catch
|
||||
let g:__exception = v:exception
|
||||
endtry
|
||||
]]):format(cmd:gsub('\n', '\\n'):gsub('[\\"]', '\\%0')))
|
||||
local ret = M.eval('get(g:, "__exception", 0)')
|
||||
M.command('unlet! g:__exception')
|
||||
return ret
|
||||
end
|
||||
|
||||
function M.exec(code)
|
||||
M.api.nvim_exec2(code, {})
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user