aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjgmdev <jgmdev@gmail.com>2022-06-24 15:28:08 -0400
committerjgmdev <jgmdev@gmail.com>2022-06-24 15:28:08 -0400
commit582caf3b07ea32c10646faafd70d6efeeb264057 (patch)
tree91a9b72bd4d8b074b9d62aac421362ef39fbe62b
parentc641bd8866890d83b40fdea787ea748175c2911e (diff)
downloadlite-xl-plugins-582caf3b07ea32c10646faafd70d6efeeb264057.tar.gz
lite-xl-plugins-582caf3b07ea32c10646faafd70d6efeeb264057.zip
settings: error if widgets not found with url to repo
-rw-r--r--plugins/settings.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/settings.lua b/plugins/settings.lua
index bbbdb3c..a489430 100644
--- a/plugins/settings.lua
+++ b/plugins/settings.lua
@@ -5,7 +5,14 @@ local common = require "core.common"
local command = require "core.command"
local keymap = require "core.keymap"
local style = require "core.style"
-local Widget = require "widget"
+
+-- check if widget is installed before proceeding
+local widget_found, Widget = pcall(require, "widget")
+if not widget_found then
+ core.error("Widget library not found: https://github.com/lite-xl/lite-xl-widgets")
+ return
+end
+
local Label = require "widget.label"
local Line = require "widget.line"
local NoteBook = require "widget.notebook"