diff options
author | Guldoman <giulio.lettieri@gmail.com> | 2022-04-14 13:33:14 -0400 |
---|---|---|
committer | jgmdev <jgmdev@gmail.com> | 2022-05-22 13:20:25 -0400 |
commit | 879ca7690a5614480ea236eeb707f940e7f46500 (patch) | |
tree | aba95b9cf34a9992545258ec624985f0b1862669 /plugins | |
parent | 826fbc80a3295a64e6a23caf41a6580107ab9660 (diff) | |
download | lite-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.lua | 8 |
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) |