mirror of
https://github.com/ThePrimeagen/harpoon
synced 2024-09-16 21:44:02 +02:00
feat: redraw tabline
This commit is contained in:
parent
8cb54c4003
commit
fef97d4439
2 changed files with 16 additions and 2 deletions
|
@ -11,10 +11,17 @@ local callbacks = {}
|
|||
-- need one event emitted
|
||||
local function emit_changed()
|
||||
log.trace("_emit_changed()")
|
||||
if harpoon.get_global_settings().save_on_change then
|
||||
|
||||
local global_settings = harpoon.get_global_settings()
|
||||
|
||||
if global_settings.save_on_change then
|
||||
harpoon.save()
|
||||
end
|
||||
|
||||
if global_settings.tabline then
|
||||
vim.cmd("redrawt")
|
||||
end
|
||||
|
||||
if not callbacks["changed"] then
|
||||
log.trace("_emit_changed(): no callbacks for 'changed', returning")
|
||||
return
|
||||
|
|
|
@ -39,7 +39,14 @@ function M.setup(opts)
|
|||
for i, tab in ipairs(original_tabs) do
|
||||
local is_current = string.match(vim.fn.bufname(), tab.filename) or vim.fn.bufname() == tab.filename
|
||||
|
||||
local label = tabs[i].filename
|
||||
local label
|
||||
|
||||
if tabs[i].filename == "" or tabs[i].filename == "(empty)" then
|
||||
label = "(empty)"
|
||||
is_current = false
|
||||
else
|
||||
label = tabs[i].filename
|
||||
end
|
||||
|
||||
|
||||
if is_current then
|
||||
|
|
Loading…
Reference in a new issue