mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-14 01:50:27 +00:00
feat(mark): add status method
This method can be used to display current mark status in the statusline
This commit is contained in:
parent
a6faacee32
commit
aefeb6bc9d
@ -60,6 +60,15 @@ M.get_index_of = function(item)
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
M.status = function()
|
||||||
|
local idx = M.get_index_of(get_buf_name())
|
||||||
|
|
||||||
|
if M.valid_index(idx) then
|
||||||
|
return "M" .. idx
|
||||||
|
end
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
|
||||||
M.valid_index = function(idx)
|
M.valid_index = function(idx)
|
||||||
local config = harpoon.get_mark_config()
|
local config = harpoon.get_mark_config()
|
||||||
return idx ~= nil and config.marks[idx] ~= nil and config.marks[idx] ~= ""
|
return idx ~= nil and config.marks[idx] ~= nil and config.marks[idx] ~= ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user