refactor: remove useless code

This commit is contained in:
JuanZoran
2023-03-08 11:53:41 +08:00
parent 831108a316
commit 8f6b1d4069
7 changed files with 122 additions and 117 deletions

View File

@ -4,10 +4,11 @@ local api = vim.api
local M = require('Trans')
local new_command = api.nvim_create_user_command
new_command('Translate', function() M.translate() end, { desc = ' 单词翻译', })
new_command('TranslateInput', function() M.translate('i') end, { desc = ' 搜索翻译', })
new_command('TransPlay', function()
local word = M.get_word(api.nvim_get_mode().mode)
if word ~= '' and word:isEn() then
word:play()
end
end, { desc = ' 自动发音' })
-- new_command('TranslateInput', function() M.translate { mode = 'i' } end, { desc = ' 搜索翻译', })
-- new_command('TransPlay', function()
-- local word = M.get_word(api.nvim_get_mode().mode)
-- if word ~= '' and word:isEn() then
-- word:play()
-- end
-- end, { desc = ' 自动发音' })