From 1e1d2dd66f040a11032ab65a1c69d272cedb4cb5 Mon Sep 17 00:00:00 2001 From: Adrian Miranda Date: Thu, 15 Aug 2024 09:17:46 -0300 Subject: [PATCH] feat: adds the ability to set a prefix to winbar (#1482) --- lua/lspsaga/init.lua | 1 + lua/lspsaga/symbol/winbar.lua | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/lspsaga/init.lua b/lua/lspsaga/init.lua index 0f8f6daf..2c0698e0 100644 --- a/lua/lspsaga/init.lua +++ b/lua/lspsaga/init.lua @@ -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, diff --git a/lua/lspsaga/symbol/winbar.lua b/lua/lspsaga/symbol/winbar.lua index 2c7bf604..17638534 100644 --- a/lua/lspsaga/symbol/winbar.lua +++ b/lua/lspsaga/symbol/winbar.lua @@ -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#'