From ea3def79926d3d49b51f3bff4aaf54e90b82ad67 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Mon, 5 Sep 2022 18:38:12 -0400 Subject: settings: reapply user project and init settings after load, also added clear font cache button --- plugins/settings.lua | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/plugins/settings.lua b/plugins/settings.lua index 89521ab..a9fd1b9 100644 --- a/plugins/settings.lua +++ b/plugins/settings.lua @@ -26,6 +26,7 @@ local FoldingBook = require "widget.foldingbook" local FontsList = require "widget.fontslist" local ItemsList = require "widget.itemslist" local KeybindingDialog = require "widget.keybinddialog" +local Fonts = require "widget.fonts" local settings = {} @@ -163,6 +164,15 @@ settings.add("General", icon = "P", on_click = "core:open-user-module" }, + { + label = "Clear Fonts Cache", + description = "Delete current font cache and regenerate a fresh one.", + type = settings.type.BUTTON, + icon = "C", + on_click = function() + Fonts.clean_cache() + end + }, { label = "Maximum Project Files", description = "The maximum amount of project files to register.", @@ -171,8 +181,10 @@ settings.add("General", default = 2000, min = 1, max = 100000, - on_apply = function() - core.rescan_project_directories() + on_apply = function(button, x, y) + if button == "left" then + core.rescan_project_directories() + end end }, { @@ -1727,6 +1739,10 @@ function core.run() end) end + -- re-apply user settings + core.load_user_directory() + core.load_project_module() + core_run() end -- cgit v1.2.3