mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
fix(edgy): improve edgy.lua bufferline offset logic
Use already defined Bufferline offsets or use Edgy offset if none are found. Properly set offset separator position depending on offset location.
This commit is contained in:
parent
2a7ba6d09c
commit
087dccf2f3
1 changed files with 6 additions and 3 deletions
|
|
@ -152,14 +152,17 @@ return {
|
|||
local get = Offset.get
|
||||
Offset.get = function()
|
||||
if package.loaded.edgy then
|
||||
local old_offset = get()
|
||||
local layout = require("edgy.config").layout
|
||||
local ret = { left = "", left_size = 0, right = "", right_size = 0 }
|
||||
for _, pos in ipairs({ "left", "right" }) do
|
||||
local sb = layout[pos]
|
||||
if sb and #sb.wins > 0 then
|
||||
local title = " Sidebar" .. string.rep(" ", sb.bounds.width - 8)
|
||||
ret[pos] = "%#EdgyTitle#" .. title .. "%*" .. "%#WinSeparator#│%*"
|
||||
ret[pos .. "_size"] = sb.bounds.width
|
||||
if sb and #sb.wins > 0 then
|
||||
ret[pos] = old_offset[pos .. "_size"] > 0 and old_offset[pos]
|
||||
or pos == "left" and ("%#Bold#" .. title .. "%*" .. "%#BufferLineOffsetSeparator#│%*")
|
||||
or pos == "right" and ("%#BufferLineOffsetSeparator#│%*" .. "%#Bold#" .. title .. "%*")
|
||||
ret[pos .. "_size"] = old_offset[pos .. "_size"] > 0 and old_offset[pos .. "_size"] or sb.bounds.width
|
||||
end
|
||||
end
|
||||
ret.total_size = ret.left_size + ret.right_size
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue