refactor: try to remove dependency for plenary.curl
This commit is contained in:
@@ -3,22 +3,10 @@ return function(opts)
|
||||
if opts then
|
||||
M.conf = vim.tbl_deep_extend('force', M.conf, opts)
|
||||
end
|
||||
local conf = M.conf
|
||||
|
||||
local set_hl = vim.api.nvim_set_hl
|
||||
local hls = require('Trans.style.theme')[conf.theme]
|
||||
local hls = require('Trans.style.theme')[M.conf.theme]
|
||||
for hl, opt in pairs(hls) do
|
||||
set_hl(0, hl, opt)
|
||||
end
|
||||
|
||||
|
||||
local path = vim.fn.expand("$HOME/.vim/dict/Trans.json")
|
||||
local file = io.open(path, "r")
|
||||
if file then
|
||||
local content = file:read("*a")
|
||||
file:close()
|
||||
local status, engine = pcall(vim.json.decode, content)
|
||||
assert(status, 'Unable to parse json file: ' .. path)
|
||||
|
||||
conf.engine = engine
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user