aboutsummaryrefslogtreecommitdiff
path: root/plugins/minimap.lua
diff options
context:
space:
mode:
authorcukmekerb <cukmekerb@gmail.com>2021-09-11 13:44:19 -0700
committercukmekerb <cukmekerb@gmail.com>2021-09-11 13:44:19 -0700
commit132e67f214d20840e207da5703789f2f57c4845f (patch)
tree92484be9c443c2ca27cdfc1d7645364f5dedfcb5 /plugins/minimap.lua
parent43f8837c52680e0e502c0a0d3f6f243e930f34af (diff)
downloadlite-xl-plugins-132e67f214d20840e207da5703789f2f57c4845f.tar.gz
lite-xl-plugins-132e67f214d20840e207da5703789f2f57c4845f.zip
make minimap displace DocView
Diffstat (limited to 'plugins/minimap.lua')
-rw-r--r--plugins/minimap.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/minimap.lua b/plugins/minimap.lua
index c9e1c54..3f4a2a2 100644
--- a/plugins/minimap.lua
+++ b/plugins/minimap.lua
@@ -289,6 +289,13 @@ DocView.draw_scrollbar = function(self)
end
+local prev_update = DocView.update
+DocView.update = function (self)
+ if not config.plugins.minimap.enabled then return prev_update(self) end
+ self.size.x = self.size.x - config.plugins.minimap.width * SCALE
+ return prev_update(self)
+end
+
command.add(nil, {
["minimap:toggle-visibility"] = function()
config.plugins.minimap.enabled = not config.plugins.minimap.enabled