diff options
author | jgmdev <jgmdev@gmail.com> | 2023-01-12 21:51:26 -0400 |
---|---|---|
committer | jgmdev <jgmdev@gmail.com> | 2023-01-12 21:51:33 -0400 |
commit | 636a7044c7cc49c1bf458d30069d41b1502a3e14 (patch) | |
tree | a6cb906abde7d2181a922c1686c8d28b25a401f0 | |
parent | 306fb17d9476e87c46bb926a1d42aebc9988332e (diff) | |
download | lite-xl-plugins-636a7044c7cc49c1bf458d30069d41b1502a3e14.tar.gz lite-xl-plugins-636a7044c7cc49c1bf458d30069d41b1502a3e14.zip |
minimap: use settings new color widget support
-rw-r--r-- | manifest.json | 2 | ||||
-rw-r--r-- | plugins/minimap.lua | 33 |
2 files changed, 13 insertions, 22 deletions
diff --git a/manifest.json b/manifest.json index 86bce40..0f0e79b 100644 --- a/manifest.json +++ b/manifest.json @@ -917,7 +917,7 @@ }, { "description": "Shows a minimap on the right-hand side of the docview. Taken from [@andsve](https://github.com/andsve/lite-plugins/tree/minimap-plugin), and improved upon.", - "version": "0.1", + "version": "0.2", "path": "plugins/minimap.lua", "id": "minimap", "mod_version": "3" diff --git a/plugins/minimap.lua b/plugins/minimap.lua index 75eb272..ac94849 100644 --- a/plugins/minimap.lua +++ b/plugins/minimap.lua @@ -135,29 +135,21 @@ config.plugins.minimap = common.merge({ }, { label = "Selection Color", - description = "Background color of selected text in html notation eg: #FFFFFF. Leave empty to use default.", - path = "selection_color_html", - type = "string", - on_apply = function(value) - if value and value:match("#%x%x%x%x%x%x") then - config.plugins.minimap.selection_color = { common.color(value) } - else - config.plugins.minimap.selection_color = nil - end - end + description = "Background color of selected text.", + path = "selection_color", + type = "color", + default = string.format("#%02X%02X%02X%02X", + style.dim[1], style.dim[2], style.dim[3], style.dim[4] + ) }, { label = "Caret Color", - description = "Background color of active line in html notation eg: #FFFFFF. Leave empty to use default.", - path = "caret_color_html", - type = "string", - on_apply = function(value) - if value and value:match("#%x%x%x%x%x%x") then - config.plugins.minimap.caret_color = { common.color(value) } - else - config.plugins.minimap.caret_color = nil - end - end + description = "Background color of active line.", + path = "caret_color", + type = "color", + default = string.format("#%02X%02X%02X%02X", + style.caret[1], style.caret[2], style.caret[3], style.caret[4] + ) }, { label = "Highlight Alignment", @@ -663,4 +655,3 @@ command.add("core.docview!", { }) return MiniMap - |