aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGuldoman <giulio.lettieri@gmail.com>2022-04-14 13:33:14 -0400
committerjgmdev <jgmdev@gmail.com>2022-05-22 13:20:25 -0400
commit879ca7690a5614480ea236eeb707f940e7f46500 (patch)
treeaba95b9cf34a9992545258ec624985f0b1862669 /plugins
parent826fbc80a3295a64e6a23caf41a6580107ab9660 (diff)
downloadlite-xl-plugins-879ca7690a5614480ea236eeb707f940e7f46500.tar.gz
lite-xl-plugins-879ca7690a5614480ea236eeb707f940e7f46500.zip
minimap: fix to work with lite-xl#916
Diffstat (limited to 'plugins')
-rw-r--r--plugins/minimap.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/minimap.lua b/plugins/minimap.lua
index 977e2ee..618e3b7 100644
--- a/plugins/minimap.lua
+++ b/plugins/minimap.lua
@@ -190,6 +190,14 @@ DocView.get_scrollbar_rect = function(self)
self.position.y, config.plugins.minimap.width * SCALE, self.size.y
end
+local prev_get_scrollbar_track_rect = DocView.get_scrollbar_track_rect
+DocView.get_scrollbar_track_rect = function(self)
+ if not show_minimap() then return prev_get_scrollbar_track_rect(self) end
+
+ return self.position.x + self.size.x - config.plugins.minimap.width * SCALE,
+ self.position.y, config.plugins.minimap.width * SCALE, self.size.y
+end
+
-- Overloaded so we can render the minimap in the "scrollbar area".
local prev_draw_scrollbar = DocView.draw_scrollbar
DocView.draw_scrollbar = function(self)