Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: compatibility with rocks-git.nvim #5

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lua/rocks-lazy/internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ function rocks_lazy.load()
local user_rocks = api.get_user_rocks()

local has_rocks_config, rocks_config = pcall(require, "rocks-config")
---@type fun(name: string) | nil
local config_hook = has_rocks_config and type(rocks_config.configure) == "function" and rocks_config.configure
or nil
---@param name string
local config_hook = function(name)
if has_rocks_config and type(rocks_config.configure) == "function" then
pcall(vim.cmd.packadd, { name, bang = true })
rocks_config.configure(name)
end
end

--- HACK: For some reason, if a RockSpec contains a list
--- (e.g. colorscheme = [ .. ]) then vim.deepcopy errors
Expand Down
Loading