Skip to content

Commit

Permalink
barbar: make minor refinements to api calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Jun 7, 2024
1 parent 545553f commit 39f5e9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lua/nxvim/plugins/barbar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ nx.au({
"FileType",
pattern = { "NeogitStatus", "DiffviewFiles" },
callback = function()
vim.defer_fn(function() barbar_api.set_offset(0) end, 75)
vim.defer_fn(function() barbar_api.set_offset(0) end, 100)
end,
})
-- <== }
Expand Down
9 changes: 2 additions & 7 deletions lua/nxvim/plugins/neo-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ local function set_offset()
if not barbar_ok then return end
local title = " 󰙅 " .. utils.truc_path(vim.fn.getcwd())
local space = neo_tree_win.width - title:len()
local filler = space > 0 and (" "):rep(neo_tree_win.width - title:len()) or ""
local filler = space > 0 and (" "):rep(space) or " "
barbar_api.set_offset(neo_tree_win.width + 2, title .. filler .. spacer)
end

Expand All @@ -186,17 +186,12 @@ config.event_handlers = {
neo_tree_win.width = vim.api.nvim_win_get_width(args.winid)
end,
},
{
event = "neo_tree_window_before_close",
handler = function()
if barbar_ok then barbar_api.set_offset(0) end
end,
},
{
event = "neo_tree_window_after_close",
handler = function()
if require("nxvim.plugins.windows").auto_maximize then vim.cmd("WindowsMaximize") end
neo_tree_win.id = -1
if barbar_ok then barbar_api.set_offset(0) end
end,
},
}
Expand Down

0 comments on commit 39f5e9f

Please sign in to comment.