fix: fix typo

This commit is contained in:
JuanZoran
2023-01-29 14:09:15 +08:00
parent 9f93247c22
commit 2bdb386272
4 changed files with 13 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ local title = vim.fn.has('nvim-0.9') == 1 and {
{ '', 'TransTitleRound' },
{ ' Trans', 'TransTitle' },
{ '', 'TransTitleRound' },
} or nil --[[ { ' Trans', 'TransTitleRound' } ]]
} or nil
M.conf = {
@@ -19,7 +19,6 @@ M.conf = {
border = 'rounded',
title = title,
keymap = {
-- TODO :
pageup = '[[',
pagedown = ']]',
pin = '<leader>[',

View File

@@ -47,6 +47,8 @@ local function set_title()
it('', round)
)
)
title:newline('')
end
end

View File

@@ -252,7 +252,8 @@ action = {
play = vim.fn.has('linux') == 1 and function()
vim.fn.jobstart('echo ' .. m_result.word .. ' | festival --tts')
end or function()
local file = debug.getinfo(1, "S").source:sub(2):match('(.*)lua/') .. 'tts/say.js'
local seperator = vim.fn.has('unix') and '/' or '\\'
local file = debug.getinfo(1, "S").source:sub(2):match('(.*)lua') .. seperator .. 'tts' .. seperator .. 'say.js'
vim.fn.jobstart('node ' .. file .. ' ' .. m_result.word)
end,
}
@@ -280,7 +281,12 @@ return function(word)
m_content = m_window.contents[1]
if m_result then
if hover.auto_play then action.play() end
if hover.auto_play then
local ok = pcall(action.play)
if not ok then
vim.notify('自动发音失败, 请检查README发音部分', vim.log.WARN)
end
end
for _, field in ipairs(conf.order) do
process[field]()