docs: modify readme file

This commit is contained in:
JuanZoran
2023-01-10 23:37:26 +08:00
parent 01f5882b13
commit 17ffaf69c9
4 changed files with 122 additions and 58 deletions

View File

@ -4,14 +4,13 @@ local core = require("Trans.core")
local function get_opts(opts)
local mode = vim.api.nvim_get_mode().mode
local default_conf = {
method = vim.api.nvim_get_mode().mode,
engine = {
'offline',
-- TODO : other engine
},
method = mode,
engine = conf.base.engine,
win = {
style = 'cursor',
style = conf.style.ui[opts.method or mode],
width = conf.style.window.cursor.width,
height = conf.style.window.cursor.height
},
@ -36,7 +35,6 @@ local function get_opts(opts)
return vim.tbl_extend('force', default_conf, opts)
end
-- EXAMPLE :
-- require('Trans').translate({
-- method = 'input', -- 不填则自动判断mode获取查询的单词
@ -85,7 +83,6 @@ local function create_win(win)
return bufnr, winid
end
local function translate(opts)
vim.validate {
opts = { opts, 'table', true }