Skip to content

Commit

Permalink
stl: expose separator icons
Browse files Browse the repository at this point in the history
  • Loading branch information
siduck committed Jul 9, 2024
1 parent c902f5f commit 8374b29
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
10 changes: 2 additions & 8 deletions lua/nvchad/stl/default.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
8 changes: 2 additions & 6 deletions lua/nvchad/stl/minimal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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#"
Expand Down
7 changes: 7 additions & 0 deletions lua/nvchad/stl/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8374b29

Please sign in to comment.