diff options
author | jgmdev <jgmdev@gmail.com> | 2022-09-05 18:38:12 -0400 |
---|---|---|
committer | jgmdev <jgmdev@gmail.com> | 2022-09-05 18:38:12 -0400 |
commit | ea3def79926d3d49b51f3bff4aaf54e90b82ad67 (patch) | |
tree | ed34a3e8c82be95f500ed9938d701b145772192d /plugins | |
parent | 6700c4f5c1fd11938de379592e191302e0026bea (diff) | |
download | lite-xl-plugins-ea3def79926d3d49b51f3bff4aaf54e90b82ad67.tar.gz lite-xl-plugins-ea3def79926d3d49b51f3bff4aaf54e90b82ad67.zip |
settings: reapply user project and init settings after load, also added clear font cache button
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/settings.lua | 20 |
1 files 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 = {} @@ -164,6 +165,15 @@ settings.add("General", 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.", path = "max_project_files", @@ -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 |