Skip to content

Commit 9fd2345

Browse files
chaozwnmehalter
authored andcommitted
feat(component): add click support for venv-selector.nvim if available
1 parent 9be4e9c commit 9fd2345

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lua/astroui/status/component.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,12 @@ function M.virtual_env(opts)
348348
virtual_env = { icon = { kind = "Environment", padding = { right = 1 } } },
349349
surround = { separator = "right", color = "virtual_env_bg", condition = condition.has_virtual_env },
350350
hl = hl.get_attributes "virtual_env",
351+
on_click = {
352+
name = "heirline_virtual_env",
353+
callback = function()
354+
if is_available "venv-selector.nvim" then vim.schedule(vim.cmd.VenvSelect) end
355+
end,
356+
},
351357
}, opts)
352358
return M.builder(status_utils.setup_providers(opts, { "virtual_env" }))
353359
end

0 commit comments

Comments
 (0)