fix: fix window width and height and fix auto_play

This commit is contained in:
JuanZoran 2023-01-21 21:35:10 +08:00
parent 294ffe1b9f
commit c4a6ccf481
4 changed files with 8 additions and 9 deletions

@ -102,7 +102,7 @@ local content = {
load = function()
assert(size > 1, 'no item need be loaded')
local space = math.floor((self.window.width - width) / (size - 1))
assert(space > 0, 'try to expand window width')
assert(space > 0, vim.inspect(items))
local interval = (' '):rep(space)
local line = ''

@ -7,8 +7,8 @@ M.conf = {
v = 'hover',
},
hover = {
width = 36,
height = 26,
width = 37,
height = 27,
border = 'rounded',
title = {
{ '', 'TransTitleRound' },

@ -270,9 +270,6 @@ return function(word)
-- 目前只处理了本地数据库的查询
m_result = require('Trans.query.offline')(word)
local hover = conf.hover
if hover.auto_play then
action.play()
end
local opt = {
relative = 'cursor',
@ -289,6 +286,10 @@ return function(word)
m_content = m_window.contents[1]
if m_result then
if hover.auto_play then
action.play()
end
for _, field in ipairs(conf.order) do
process[field]()
end

@ -1,6 +1,4 @@
const say = require('say')
word = process.argv
// console.log(word)
say.speak(word.slice(2))
say.speak(process.argv.slice(2))