mirror of
https://github.com/neovim/neovim.git
synced 2025-11-04 17:54:30 +00:00
tests: Use write_file() in source().
This commit is contained in:
@@ -217,10 +217,7 @@ end
|
|||||||
|
|
||||||
local function source(code)
|
local function source(code)
|
||||||
local tmpname = os.tmpname()
|
local tmpname = os.tmpname()
|
||||||
local tmpfile = io.open(tmpname, "w")
|
write_file(tmpname, code)
|
||||||
tmpfile:write(code)
|
|
||||||
tmpfile:flush()
|
|
||||||
tmpfile:close()
|
|
||||||
nvim_command('source '..tmpname)
|
nvim_command('source '..tmpname)
|
||||||
os.remove(tmpname)
|
os.remove(tmpname)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user