refactor: remove TransMode, use vim-mode

This commit is contained in:
JuanZoran
2023-03-22 23:09:09 +08:00
parent e90b55d297
commit 8e9ccfc8f7
6 changed files with 26 additions and 42 deletions

View File

@ -30,13 +30,13 @@ end, { desc = " Translate cursor word" })
command("TranslateInput", function()
Trans.translate({ mode = 'input' })
Trans.translate({ mode = 'i' })
end, { desc = " Translate input word" })
command("TransPlay", function()
--- FIXME :
local str = Trans.util.get_str(api.nvim_get_mode().mode)
if str and str ~= "" and Trans.util.is_English(str) then
local util = Trans.util
local str = util.get_str(vim.fn.mode())
if str and str ~= "" and util.is_English(str) then
str:play()
end
end, { desc = "auto play" })
end, { desc = "Auto play" })