From 07483f4b1a85e1ea7c1dbcdc42389ae80200db01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Boczar?= Date: Mon, 13 Nov 2023 12:51:22 +0100 Subject: [PATCH] fix(telescope): avoid error when plugin_data is nil --- lua/possession/display.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/possession/display.lua b/lua/possession/display.lua index 5b14e6b..38f656f 100644 --- a/lua/possession/display.lua +++ b/lua/possession/display.lua @@ -266,7 +266,7 @@ local function buf_display_builder(buf) end local function remove_empty_plugin_data(plugin_data) - for plugin, data in pairs(plugin_data) do + for plugin, data in pairs(plugin_data or {}) do if type(data) == 'table' and utils.tbl_deep_count(data) == 0 then plugin_data[plugin] = nil end @@ -341,6 +341,7 @@ local function in_buffer_pretty(data, buf, opts) end end + data.plugins = data.plugins or {} if not opts.include_empty_plugin_data then remove_empty_plugin_data(data.plugins) end