refactoring
This commit is contained in:
parent
74ae1150a3
commit
69400c1aa3
142 changed files with 11 additions and 70 deletions
33
modules/home/yazi/plugins/yatline-symlink.yazi/main.lua
Normal file
33
modules/home/yazi/plugins/yatline-symlink.yazi/main.lua
Normal file
|
@ -0,0 +1,33 @@
|
|||
function hovered()
|
||||
local hovered = cx.active.current.hovered
|
||||
if hovered then
|
||||
return hovered
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end
|
||||
|
||||
local function setup(_, options)
|
||||
options = options or {}
|
||||
|
||||
local config = {
|
||||
symlink_color = options.symlink_color or "silver",
|
||||
}
|
||||
|
||||
if Yatline ~= nil then
|
||||
function Yatline.coloreds.get:symlink()
|
||||
local symlink = {}
|
||||
local linked = ""
|
||||
|
||||
local h = hovered()
|
||||
if h.link_to ~= nil then
|
||||
linked = " -> " .. tostring(h.link_to)
|
||||
end
|
||||
|
||||
table.insert(symlink, { linked, config.symlink_color })
|
||||
return symlink
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return { setup = setup }
|
Loading…
Add table
Add a link
Reference in a new issue