feat: adds the ability to set a prefix to winbar (#1482)

This commit is contained in:
Adrian Miranda 2024-08-15 09:17:46 -03:00 committed by GitHub
parent a751b92b5d
commit 1e1d2dd66f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -4,6 +4,7 @@ saga.saga_augroup = api.nvim_create_augroup('Lspsaga', { clear = true })
local default_config = {
ui = {
winbar_prefix = '',
border = 'rounded',
devicon = true,
foldericon = true,

View file

@ -23,7 +23,7 @@ local function path_in_bar(buf)
local items = {}
local folder
if ui.foldericon then
folder = get_kind_icon(302)[2]
folder = ui.winbar_prefix .. get_kind_icon(302)[2]
end
for item in util.path_itera(buf) do
@ -34,7 +34,7 @@ local function path_in_bar(buf)
and '%#' .. (hl or 'SagaFileIcon') .. '#' .. (icon and icon .. ' ' or '') .. '%*' .. bar.prefix .. 'FileName#' .. item
or bar.prefix
.. 'Folder#'
.. (folder and folder or '')
.. (folder and folder or ui.winbar_prefix)
.. '%*'
.. bar.prefix
.. 'FolderName#'