From 582caf3b07ea32c10646faafd70d6efeeb264057 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Fri, 24 Jun 2022 15:28:08 -0400 Subject: settings: error if widgets not found with url to repo --- plugins/settings.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'plugins') 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" -- cgit v1.2.3