fix: try reducing some bugs

This commit is contained in:
JuanZoran
2023-01-10 14:40:28 +08:00
parent 671e3cc7e7
commit 1b95485ae6
8 changed files with 163 additions and 45 deletions

View File

@@ -69,6 +69,7 @@ function M:data()
-- NOTE 返回格式化的行,如果需要高亮,则第二个参数返回高亮
local lines = {}
local highlights = {}
for index = 1, #self.lines do
local line = ''
local highlight = {}

View File

@@ -37,15 +37,15 @@ local icon = require("Trans.conf.loader").loaded_conf.ui.icon
---@return component component 提取的组件信息[包含多个组件]
M.component = function(field)
local component = {}
local stuffs = {}
local data = {
{field.word, 'TransWord'},
{ field.word, 'TransWord' },
}
if display.phonetic and field.phonetic then
table.insert(data, {
'[' .. field.phonetic .. ']', 'TransPhonetic'
})
if display.phnoetic and field.phonetic ~= '' then
table.insert(
data,
{ '[' .. field.phonetic .. ']', 'TransPhonetic' }
)
end
if display.collins and field.collins then
@@ -55,13 +55,12 @@ M.component = function(field)
end
if display.oxford and field.oxford then
table.insert(data, {
field.oxford
})
table.insert(data,
{ field.oxford == 1 and icon.isOxford or icon.notOxford, }
)
end
stuffs.data = data
component[1] = stuffs
component[1] = data
return component
end