diff --git a/lua/Trans/backend/offline.lua b/lua/Trans/backend/offline.lua index 330b704..bf9a532 100644 --- a/lua/Trans/backend/offline.lua +++ b/lua/Trans/backend/offline.lua @@ -29,9 +29,24 @@ M.query = function(opts) limit = 1, })[1] - return res and formatter(res) or nil + + local ret = { + -- from = '', + -- to = '', + engine = 'offline', + } + + if res then + res.result = formatter(res) + -- TODO + else + -- TODO : + end + + return ret end + M.nowait = true M.field = { diff --git a/lua/Trans/backend/util.lua b/lua/Trans/backend/util.lua index 1c9b7e1..ef03e2f 100644 --- a/lua/Trans/backend/util.lua +++ b/lua/Trans/backend/util.lua @@ -11,6 +11,4 @@ M.is_English = function(str) end - return M - diff --git a/lua/Trans/wrapper/buffer.lua b/lua/Trans/wrapper/buffer.lua index 698f8dc..1c331e0 100644 --- a/lua/Trans/wrapper/buffer.lua +++ b/lua/Trans/wrapper/buffer.lua @@ -1,10 +1,10 @@ -local api, fn = vim.api, vim.fn - ---@class buf ---@field bufnr integer buffer handle ---@field size integer buffer line count local buffer = {} +local api, fn = vim.api, vim.fn + ---Clear all content in buffer function buffer:wipe() api.nvim_buf_set_lines(self.bufnr, 0, -1, false, {})