From 6d3810dfaa3eabd9a23fa433e0f308fc7b16102d Mon Sep 17 00:00:00 2001 From: Vhyrro Date: Wed, 22 Nov 2023 20:51:40 +0100 Subject: [PATCH] fix(operations): only find dependencies of rocks that exist (#21) --- lua/rocks/operations.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lua/rocks/operations.lua b/lua/rocks/operations.lua index 52a400f0..a28f7644 100644 --- a/lua/rocks/operations.lua +++ b/lua/rocks/operations.lua @@ -181,10 +181,12 @@ operations.sync = function(user_rocks) expand_ui = false end - -- NOTE(vhyrro): It is not possible to use the vim.tbl_extend or vim.tbl_deep_extend - -- functions here within the async context. It simply refuses to work. - for k, v in pairs(state.rock_dependencies(user_rocks[key] or installed_rocks[key])) do - dependencies[k] = v + if installed_rocks[key] then + -- NOTE(vhyrro): It is not possible to use the vim.tbl_extend or vim.tbl_deep_extend + -- functions here within the async context. It simply refuses to work. + for k, v in pairs(state.rock_dependencies(installed_rocks[key])) do + dependencies[k] = v + end end if expand_ui and line_nr >= 1 then