Skip to content

Commit 0ec1124

Browse files
committed
feat: add status API
1 parent 568a829 commit 0ec1124

File tree

11 files changed

+1689
-1
lines changed

11 files changed

+1689
-1
lines changed

lua/astroui/config.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
return {
2+
colorscheme = nil,
3+
highlights = {},
4+
status = {
5+
attributes = {},
6+
buf_matchers = {},
7+
colors = {},
8+
fallback_colors = {},
9+
icon_highlights = {},
10+
modes = {},
11+
separators = {},
12+
sign_handlers = {},
13+
},
214
icons_enabled = true,
315
icons = {},
416
text_icons = {},

lua/astroui/ffi.lua

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
-- ### AstroUI C Extensions
2+
3+
local ffi = require "ffi"
4+
5+
-- Custom C extension to get direct fold information from Neovim
6+
ffi.cdef [[
7+
typedef struct {} Error;
8+
typedef struct {} win_T;
9+
typedef struct {
10+
int start; // line number where deepest fold starts
11+
int level; // fold level, when zero other fields are N/A
12+
int llevel; // lowest level that starts in v:lnum
13+
int lines; // number of lines from v:lnum to end of closed fold
14+
} foldinfo_T;
15+
foldinfo_T fold_info(win_T* wp, int lnum);
16+
win_T *find_window_by_handle(int Window, Error *err);
17+
int compute_foldcolumn(win_T *wp, int col);
18+
]]
19+
20+
return ffi

lua/astroui/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ M.config = require "astroui.config"
55
function M.setup(opts) M.config = vim.tbl_deep_extend("force", M.config, opts) end
66

77
--- Get an icon from the AstroNvim internal icons if it is available and return it
8-
---@param kind string The kind of icon in astronvim.icons to retrieve
8+
---@param kind string The kind of icon in astroui.icons to retrieve
99
---@param padding? integer Padding to add to the end of the icon
1010
---@param no_fallback? boolean Whether or not to disable fallback to text icon
1111
---@return string icon

lua/astroui/status.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
return {
2+
component = require "astroui.status.component",
3+
condition = require "astroui.status.condition",
4+
heirline = require "astroui.status.heirline",
5+
hl = require "astroui.status.hl",
6+
init = require "astroui.status.init",
7+
provider = require "astroui.status.provider",
8+
utils = require "astroui.status.utils",
9+
}

0 commit comments

Comments
 (0)