fix: fix format and process function behaviours
This commit is contained in:
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user