Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: clarify bufferline-custom-areas #900

Closed
Closed
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
19 changes: 15 additions & 4 deletions doc/bufferline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1125,26 +1125,37 @@ to be shown in a list of tables. For example:
local info = #vim.diagnostic.get(0, {severity = seve.INFO})
local hint = #vim.diagnostic.get(0, {severity = seve.HINT})

table.insert(result, {text = "", fg = "#EC5241"})
table.insert(result, {text = "", fg = "#EFB839"})
table.insert(result, {text = "", fg = "#A3BA5E"})
table.insert(result, {text = "", fg = "#7EA9A7"})

if error ~= 0 then
table.insert(result, {text = "  " .. error, fg = "#EC5241"})
result[1].text = "  " .. error
end

if warning ~= 0 then
table.insert(result, {text = "  " .. warning, fg = "#EFB839"})
result[2].text = "  " .. warning
end

if hint ~= 0 then
table.insert(result, {text = "  " .. hint, fg = "#A3BA5E"})
result[3].text = "  " .. hint
end

if info ~= 0 then
table.insert(result, {text = "  " .. info, fg = "#7EA9A7"})
result[4].text = "  " .. info
end

return result
end,
}
<


This option will create a highlight groups for each table insert whether defined or not. For best experience,
define all of your highlights if you are conditionally displaying text, otherwise your text may appear
under unexpected highlight groups.

Please note that this function will be called a lot and should be as inexpensive as possible so it does
not block rendering the tabline.

Expand Down