mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-13 09:30:25 +00:00
feat: redraw tabline
This commit is contained in:
parent
8cb54c4003
commit
fef97d4439
@ -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…
x
Reference in New Issue
Block a user