Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lua/barbar/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ local GIT_STATUSES = {'added', 'changed', 'deleted'}
--- @field preset barbar.config.options.icons.preset
--- @field scroll barbar.config.options.icons.scroll the scroll arrows
--- @field separator_at_end boolean if true, add an additional separator at the end of the buffer list
--- @field separator_at_start boolean if false, remove the left separator of the first buffer in the list
--- @field visible barbar.config.options.icons.state the icons for visible buffers

--- @type {[barbar.config.options.icons.preset]: fun(default_icons: barbar.config.options.icons, user_icons?: table)}
Expand All @@ -108,6 +109,7 @@ local ICON_PRESETS = {
default_icons.inactive = { separator = { left = '▎', right = '' } } --- @diagnostic disable-line: missing-fields
default_icons.separator = { left = '▎', right = '' }
default_icons.separator_at_end = true
default_icons.separator_at_start = true

local pinned_icons = user_icons and user_icons.pinned
if pinned_icons == nil or
Expand Down
5 changes: 5 additions & 0 deletions lua/barbar/ui/render.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
local ceil = math.ceil
local max = math.max
local table_insert = table.insert
local table_remove = table.remove

local buf_get_option = vim.api.nvim_buf_get_option --- @type function
local command = vim.api.nvim_command --- @type function
Expand Down Expand Up @@ -439,6 +440,10 @@ local function generate_tabline(bufnrs, refocus)
end
end

if not config.options.icons.separator_at_start then
table_remove(content, 1)
end

if config.options.icons.separator_at_end then
local inactive_separator = config.options.icons.inactive.separator.left
if inactive_separator ~= nil and #unpinned > 0 and
Expand Down