File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,20 @@ function M.setup(opts)
3939 end
4040end
4141
42+ --- Get highlight properties for a given highlight name
43+ --- @param name string The highlight group name
44+ --- @param fallback ? table The fallback highlight properties
45+ --- @return table properties # the highlight group properties
46+ function M .get_hlgroup (name , fallback )
47+ if vim .fn .hlexists (name ) == 1 then
48+ local hl = vim .api .nvim_get_hl (0 , { name = name , link = false })
49+ if not hl .fg then hl .fg = " NONE" end
50+ if not hl .bg then hl .bg = " NONE" end
51+ return hl
52+ end
53+ return fallback or {}
54+ end
55+
4256--- Get an icon from the AstroNvim internal icons if it is available and return it
4357--- @param kind string The kind of icon in astroui.icons to retrieve
4458--- @param padding ? integer Padding to add to the end of the icon
You can’t perform that action at this time.
0 commit comments