From 8374b298b6f2d702e8cfdf2675eafa240a9d0335 Mon Sep 17 00:00:00 2001 From: siduck Date: Tue, 9 Jul 2024 09:44:06 +0530 Subject: [PATCH] stl: expose separator icons --- lua/nvchad/stl/default.lua | 10 ++-------- lua/nvchad/stl/minimal.lua | 8 ++------ lua/nvchad/stl/utils.lua | 7 +++++++ 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/lua/nvchad/stl/default.lua b/lua/nvchad/stl/default.lua index 28f6dc59..7cd9d489 100644 --- a/lua/nvchad/stl/default.lua +++ b/lua/nvchad/stl/default.lua @@ -2,14 +2,8 @@ local config = require("nvconfig").ui.statusline local sep_style = config.separator_style local utils = require "nvchad.stl.utils" -local default_sep_icons = { - default = { left = "", right = "" }, - round = { left = "", right = "" }, - block = { left = "█", right = "█" }, - arrow = { left = "", right = "" }, -} - -local separators = (type(sep_style) == "table" and sep_style) or default_sep_icons[sep_style] +local sep_icons = utils.separators +local separators = (type(sep_style) == "table" and sep_style) or sep_icons[sep_style] local sep_l = separators["left"] local sep_r = separators["right"] diff --git a/lua/nvchad/stl/minimal.lua b/lua/nvchad/stl/minimal.lua index 1947857d..8719c8f6 100644 --- a/lua/nvchad/stl/minimal.lua +++ b/lua/nvchad/stl/minimal.lua @@ -4,12 +4,8 @@ local utils = require "nvchad.stl.utils" sep_style = (sep_style ~= "round" and sep_style ~= "block") and "block" or sep_style -local default_sep_icons = { - round = { left = "", right = "" }, - block = { left = "█", right = "█" }, -} - -local separators = (type(sep_style) == "table" and sep_style) or default_sep_icons[sep_style] +local sep_icons = utils.separators +local separators = (type(sep_style) == "table" and sep_style) or sep_icons[sep_style] local sep_l = separators["left"] local sep_r = "%#St_sep_r#" .. separators["right"] .. " %#ST_EmptySpace#" diff --git a/lua/nvchad/stl/utils.lua b/lua/nvchad/stl/utils.lua index 346d82fc..d9855b61 100644 --- a/lua/nvchad/stl/utils.lua +++ b/lua/nvchad/stl/utils.lua @@ -161,4 +161,11 @@ M.diagnostics = function() return " " .. err .. warn .. hints .. info end +M.separators = { + default = { left = "", right = "" }, + round = { left = "", right = "" }, + block = { left = "█", right = "█" }, + arrow = { left = "", right = "" }, +} + return M