feat: more icon support
This commit is contained in:
parent
1367537926
commit
aabe1f3a8f
@ -95,12 +95,18 @@ return {
|
|||||||
---@type table<string, string>
|
---@type table<string, string>
|
||||||
icon = {
|
icon = {
|
||||||
-- or use emoji
|
-- or use emoji
|
||||||
list = '●', -- ● | ○ | ◉ | ◯ | ◇ | ◆ | ▪ | ▫ | ⬤ | ⬛ | ⬜ | ◻ | ◼ | ◾ | ◽ | ▣ | ▤ | ▥ | ▦ | ▧ | ▨ | ▩ | ▪ | ▫ | ▬ | ▭ | ▮ | ▯ | ◌ | ◍ | ◎ | ● | ◐ | ◑ | ◒ | ◓ | ◔ | ◕ | ◖ | ◗ | ◘ | ◙ | ◚ | ◛ | ◜ | ◝ | ◞ | ◟ | ◠ | ◡ | ◢ | ◣ | ◤ | ◥ | ◦ | ◧ | ◨ | ◩ | ◪ | ◫ | ◬ | ◭ | ◮ | ◯ | ◰ | ◱ | ◲ | ◳ | ◴ | ◵ | ◶ | ◷ | ◸ | ◹ | ◺ | ◻ | ◼ | ◽ | ◾ | ◿ | ☀ | ☁ | ☂ | ☃ | ☄ | ★ | ☆ | ☇ | ☈ | ☉ | ☊ | ☋ | ☌ | ☍ | ☎ | ☏ | ☐ | ☑ | ☒ | ☓ | ☔ | ☕ | ☖ | ☗ | ☘ | ☙ | ☚ | ☛ | ☜ | ☝ | ☞ | ☟ | ☠ | ☡ | ☢ | ☣ | ☤ | ☥ | ☦ | ☧ | ☨ | ☩ | ☪ | ☫ | ☬ | ☭ | ☮ | ☯ | ☰ | ☱ | ☲ | ☳ | ☴ | ☵ | ☶ | ☷ | ☸ | ☹ | ☺ | ☻ | ☼ | ☽ | ☾ | ☿ | ♀ | ♂ | ♁ | ♂ | ♃ | ♄ | ♅ | ♆ | ♇ | ♈ | ♉ | ♊ | ♋ | ♌ | ♍ | ♎ | ♏ | ♐ | ♑ | ♒ | ♓ | ♔ | ♕ |
|
list = '●', -- ● | ○ | ◉ | ◯ | ◇ | ◆ | ▪ | ▫ | ⬤ | 🟢 | 🟡 | 🟣 | 🟤 | 🟦 | 🟨 | 🟧 | 🟥 | 🟪 | 🟫 | 🟩 | 🟠 | 🟦 | 🟨 | 🟧 | 🟥 | 🟪 | 🟫 | 🟩 | 🟠
|
||||||
star = '', -- ⭐
|
star = '', -- ⭐ | ✴ | ✳ | ✲ | ✱ | ✰ | ★ | ☆ | 🌟 | 🌠 | 🌙 | 🌛 | 🌜 | 🌟 | 🌠 | 🌌 | 🌙 |
|
||||||
notfound = ' ', -- ❔
|
notfound = ' ', --❔ | ❓ | ❗ | ❕|
|
||||||
yes = '✔', -- ✔️
|
yes = '✔', -- ✅ | ✔️ | ☑
|
||||||
no = '', -- ❌
|
no = '', -- ❌ | ❎ | ✖ | ✘ | ✗ |
|
||||||
cell = '■', -- ■ | □ | ▇ | ▏ ▎ ▍ ▌ ▋ ▊ ▉ █
|
cell = '■', -- ■ | □ | ▇ | ▏ ▎ ▍ ▌ ▋ ▊ ▉ █
|
||||||
|
web = '', --🌍 | 🌎 | 🌏 | 🌐 |
|
||||||
|
tag = ' ',
|
||||||
|
pos = '',
|
||||||
|
translation = '',
|
||||||
|
definition = '',
|
||||||
|
exchange = '✳',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -28,7 +28,7 @@ local default = {
|
|||||||
if not translation then return end
|
if not translation then return end
|
||||||
|
|
||||||
local buffer = hover.buffer
|
local buffer = hover.buffer
|
||||||
buffer:setline(conjunction('中文翻译'))
|
buffer:setline(conjunction(hover.opts.icon.translation .. ' 中文翻译'))
|
||||||
|
|
||||||
for _, value in ipairs(translation) do
|
for _, value in ipairs(translation) do
|
||||||
buffer:setline(
|
buffer:setline(
|
||||||
@ -43,7 +43,7 @@ local default = {
|
|||||||
if not definition then return end
|
if not definition then return end
|
||||||
|
|
||||||
local buffer = hover.buffer
|
local buffer = hover.buffer
|
||||||
buffer:setline(conjunction('英文注释'))
|
buffer:setline(conjunction(hover.opts.icon.definition .. ' 英文注释'))
|
||||||
|
|
||||||
for _, value in ipairs(definition) do
|
for _, value in ipairs(definition) do
|
||||||
buffer:setline(
|
buffer:setline(
|
||||||
|
@ -42,7 +42,7 @@ function M.tag(hover, result)
|
|||||||
if not tag then return end
|
if not tag then return end
|
||||||
|
|
||||||
local buffer = hover.buffer
|
local buffer = hover.buffer
|
||||||
buffer:setline(co('标签'))
|
buffer:setline(co(hover.opts.icon.tag .. ' 标签'))
|
||||||
|
|
||||||
local size = #tag
|
local size = #tag
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ function M.exchange(hover, result)
|
|||||||
if not exchange then return end
|
if not exchange then return end
|
||||||
|
|
||||||
local buffer = hover.buffer
|
local buffer = hover.buffer
|
||||||
buffer:setline(co('词形变化'))
|
buffer:setline(co(hover.opts.icon.exchange .. ' 词形变化'))
|
||||||
|
|
||||||
for description, value in pairs(exchange) do
|
for description, value in pairs(exchange) do
|
||||||
buffer:setline(
|
buffer:setline(
|
||||||
@ -79,7 +79,7 @@ function M.pos(hover, result)
|
|||||||
if not pos then return end
|
if not pos then return end
|
||||||
|
|
||||||
local buffer = hover.buffer
|
local buffer = hover.buffer
|
||||||
buffer:setline(co('词性'))
|
buffer:setline(co(hover.opts.icon.pos .. ' 词性'))
|
||||||
|
|
||||||
for description, value in pairs(pos) do
|
for description, value in pairs(pos) do
|
||||||
buffer:setline(
|
buffer:setline(
|
||||||
|
@ -8,7 +8,7 @@ local interval = (' '):rep(4)
|
|||||||
function M.web(hover, result)
|
function M.web(hover, result)
|
||||||
if not result.web then return end
|
if not result.web then return end
|
||||||
local buffer = hover.buffer
|
local buffer = hover.buffer
|
||||||
buffer:setline(co('网络释义'))
|
buffer:setline(co(hover.opts.icon.web .. ' 网络释义'))
|
||||||
|
|
||||||
local indent = interval .. interval .. hover.opts.icon.list .. ' '
|
local indent = interval .. interval .. hover.opts.icon.list .. ' '
|
||||||
local function remove_duplicate(strs)
|
local function remove_duplicate(strs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user