Skip to content

Commit

Permalink
Feature: add slope separator (#659)
Browse files Browse the repository at this point in the history
  • Loading branch information
Taaqif committed Feb 20, 2023
1 parent 9d95a6d commit 6837ad3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion doc/bufferline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ The available configuration are:
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
-- can also be a table containing 2 custom separators
-- [focused and unfocused]. eg: { '|', '|' }
separator_style = "slant" | "thick" | "thin" | { 'any', 'any' },
separator_style = "slant" | "slope" | "thick" | "thin" | { 'any', 'any' },
enforce_regular_tabs = false | true,
always_show_bufferline = true | false,
hover = {
Expand Down Expand Up @@ -194,6 +194,7 @@ You can change the appearance of the bufferline separators by setting the
* `slant` - Use slanted/triangular separators
* `padded_slant` - Same as `slant` but with extra padding which some terminals require.
If `slant` does not render correctly for you try padded this instead.
* `slope` - Use slanted/triangular separators but slopped to the right
* `thick` - Increase the thickness of the separator characters
* `thin` - (default) Use thin separator characters
* finally you can pass in a custom list containing 2 characters which will be
Expand Down
2 changes: 2 additions & 0 deletions lua/bufferline/constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ M.sep_names = {
thin = "thin",
thick = "thick",
slant = "slant",
slope = "slope",
padded_slant = "padded_slant",
}

Expand All @@ -18,6 +19,7 @@ M.sep_chars = {
[M.sep_names.thin] = { "", "" },
[M.sep_names.thick] = { "", "" },
[M.sep_names.slant] = { "", "" },
[M.sep_names.slope] = { "", "" },
[M.sep_names.padded_slant] = { "" .. M.padding, "" .. M.padding },
}

Expand Down
2 changes: 1 addition & 1 deletion lua/bufferline/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ end
---@param style string
---@return boolean
local function is_slant(style)
return vim.tbl_contains({ sep_names.slant, sep_names.padded_slant }, style)
return vim.tbl_contains({ sep_names.slant, sep_names.padded_slant, sep_names.slope}, style)
end

--- "▍" "░"
Expand Down

0 comments on commit 6837ad3

Please sign in to comment.