Skip to content

Commit 12ee3ff

Browse files
author
Zhe Yu
committed
feat(nvim): add heirline component
1 parent 03a7020 commit 12ee3ff

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---@class VectorCode.Heirline.Opts: VectorCode.Lualine.Opts
2+
local default_opts = { show_job_count = false }
3+
4+
---@param opts VectorCode.Heirline.Opts?
5+
return function(opts)
6+
opts = vim.tbl_deep_extend("force", default_opts, opts or {}) --[[@as VectorCode.Heirline.Opts]]
7+
local lualine_comp = require("vectorcode.integrations").lualine(opts)
8+
return {
9+
provider = function(_)
10+
return lualine_comp[1]()
11+
end,
12+
condition = function(_)
13+
return lualine_comp.cond()
14+
end,
15+
}
16+
end

lua/vectorcode/integrations/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ return {
22
codecompanion = require("vectorcode.integrations.codecompanion"),
33
copilotchat = require("vectorcode.integrations.copilotchat"),
44
lualine = require("vectorcode.integrations.lualine"),
5+
heirline = require("vectorcode.integrations.heirline"),
56
}

lua/vectorcode/integrations/lualine.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
local vc_config = require("vectorcode.config")
22

3-
---@param opts {show_job_count: boolean}?
3+
---@class VectorCode.Lualine.Opts
4+
---@field show_job_count boolean
5+
6+
---@param opts VectorCode.Lualine.Opts?
47
return function(opts)
5-
opts = vim.tbl_deep_extend("force", { show_job_count = false }, opts or {})
8+
opts = vim.tbl_deep_extend("force", { show_job_count = false }, opts or {}) --[[@as VectorCode.Lualine.Opts]]
69
local cacher = vc_config.get_cacher_backend()
710
return {
811
function()

0 commit comments

Comments
 (0)