aboutsummaryrefslogtreecommitdiff
path: root/plugins/minimap.lua
diff options
context:
space:
mode:
authorJoshua Minor <github@pixelverse.org>2021-11-27 21:48:32 -0800
committerJoshua Minor <github@pixelverse.org>2021-11-27 21:52:55 -0800
commit0652077a2532038483f487e5c925d9ba697bac75 (patch)
tree2b112548a9d21845e516ce4442e987da6ddf5703 /plugins/minimap.lua
parent3ef7a003366aea89827417e4a3ed7135feca6cd4 (diff)
downloadlite-xl-plugins-0652077a2532038483f487e5c925d9ba697bac75.tar.gz
lite-xl-plugins-0652077a2532038483f487e5c925d9ba697bac75.zip
Allow customization of minimap selection & caret colors.
Diffstat (limited to 'plugins/minimap.lua')
-rw-r--r--plugins/minimap.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/minimap.lua b/plugins/minimap.lua
index 32bcf6f..2c383b8 100644
--- a/plugins/minimap.lua
+++ b/plugins/minimap.lua
@@ -16,6 +16,13 @@ config.plugins.minimap = {
-- how many spaces one tab is equivalent to
tab_width = 4,
draw_background = true,
+
+ -- you can override these colors
+ selection_color = nil,
+ caret_color = nil,
+
+ -- If other plugins provide per-line highlights,
+ -- this controls the placement. (e.g. gitdiff_highlight)
highlight_align = 'left',
highlight_width = 3,
gutter_width = 5,
@@ -223,13 +230,15 @@ DocView.draw_scrollbar = function(self)
renderer.draw_rect(x, visible_y, w, scroller_height, visual_color)
-- highlight the selected lines, and the line with the caret on it
+ local selection_color = config.plugins.minimap.selection_color or style.dim
+ local caret_color = config.plugins.minimap.caret_color or style.caret
local selection_line, selection_col, selection_line2, selection_col2 = self.doc:get_selection()
local selection_y = y + (selection_line - minimap_start_line) * line_spacing
local selection2_y = y + (selection_line2 - minimap_start_line) * line_spacing
local selection_min_y = math.min(selection_y, selection2_y)
local selection_h = math.abs(selection2_y - selection_y)+1
- renderer.draw_rect(x, selection_min_y, w, selection_h, style.dim)
- renderer.draw_rect(x, selection_y, w, line_spacing, style.accent)
+ renderer.draw_rect(x, selection_min_y, w, selection_h, selection_color)
+ renderer.draw_rect(x, selection_y, w, line_spacing, caret_color)
local highlight_align = config.plugins.minimap.highlight_align
local highlight_width = config.plugins.minimap.highlight_width