aboutsummaryrefslogtreecommitdiff
path: root/plugins
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
parent43f8837c52680e0e502c0a0d3f6f243e930f34af (diff)
downloadlite-xl-plugins-132e67f214d20840e207da5703789f2f57c4845f.tar.gz
lite-xl-plugins-132e67f214d20840e207da5703789f2f57c4845f.zip
make minimap displace DocView
Diffstat (limited to 'plugins')
-rw-r--r--plugins/language_toml.lua2
-rw-r--r--plugins/minimap.lua7
2 files changed, 8 insertions, 1 deletions
diff --git a/plugins/language_toml.lua b/plugins/language_toml.lua
index 9de31f9..3774dfb 100644
--- a/plugins/language_toml.lua
+++ b/plugins/language_toml.lua
@@ -1,4 +1,4 @@
--- lite-xl 1.16
+-- mod-version:2
local syntax = require "core.syntax"
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