From 77f9ade2b4e0c6c46cfffd073e9a763531f9aa2f Mon Sep 17 00:00:00 2001 From: Vhyrro Date: Fri, 28 Jun 2024 20:23:48 +0200 Subject: [PATCH] fix: ensure that entry exists in rocks.toml when checking updates --- lua/rocks-edit/sources/updates.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lua/rocks-edit/sources/updates.lua b/lua/rocks-edit/sources/updates.lua index 8b77682..4f44bf3 100644 --- a/lua/rocks-edit/sources/updates.lua +++ b/lua/rocks-edit/sources/updates.lua @@ -1,16 +1,18 @@ local nio = require("nio") -require("rocks-edit.api").register(function(_, diagnostic) +require("rocks-edit.api").register(function(toml, diagnostic) nio.run(function() local updates = require("rocks.state").outdated_rocks() for name, data in pairs(updates) do - diagnostic({ - message = string.format("update available: `%s` -> `%s`", data.version, data.target_version), - path = { "plugins", name }, - selector = "key", - severity = vim.diagnostic.severity.INFO, - }) + if toml.plugins[name] then + diagnostic({ + message = string.format("update available: `%s` -> `%s`", data.version, data.target_version), + path = { "plugins", name }, + selector = "key", + severity = vim.diagnostic.severity.INFO, + }) + end end end) end)