fix: fix format and process function behaviours

This commit is contained in:
JuanZoran
2023-01-10 17:51:07 +08:00
parent 1b95485ae6
commit a57a6e47ab
14 changed files with 193 additions and 324 deletions

View File

@@ -21,6 +21,7 @@ local function get_opts(opts)
opts.engine = { opts.engine }
end
if opts.win then
local width, height = opts.win.width, opts.win.height
if width and width > 0 and width <= 1 then
@@ -35,6 +36,7 @@ local function get_opts(opts)
return vim.tbl_extend('force', default_conf, opts)
end
-- EXAMPLE :
-- require('Trans').translate({
-- method = 'input', -- 不填则自动判断mode获取查询的单词
@@ -52,6 +54,7 @@ end
-- })
local function create_win(win)
local bufnr = vim.api.nvim_create_buf(false, true)
@@ -81,6 +84,7 @@ local function create_win(win)
return bufnr, winid
end
local function translate(opts)
vim.validate {
opts = { opts, 'table', true }