aboutsummaryrefslogtreecommitdiff
path: root/plugins/hidestatus.lua
diff options
context:
space:
mode:
authorrxi <rxi@users.noreply.github.com>2020-05-01 18:56:53 +0100
committerrxi <rxi@users.noreply.github.com>2020-05-01 18:56:53 +0100
commit729168daf68170bb2216ec69008bcd66867c00da (patch)
treeed338cb10dba2e382b87b892272bb5f516fcb433 /plugins/hidestatus.lua
parent378844cfbb2b7a1489a3344e2d6a996aa2aa53aa (diff)
downloadlite-xl-plugins-729168daf68170bb2216ec69008bcd66867c00da.tar.gz
lite-xl-plugins-729168daf68170bb2216ec69008bcd66867c00da.zip
Added `hidestatus` plugin
Diffstat (limited to 'plugins/hidestatus.lua')
-rw-r--r--plugins/hidestatus.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/hidestatus.lua b/plugins/hidestatus.lua
new file mode 100644
index 0000000..5c0bb15
--- /dev/null
+++ b/plugins/hidestatus.lua
@@ -0,0 +1,18 @@
+local command = require "core.command"
+local StatusView = require "core.statusview"
+
+local visible = false
+local funcs = {
+ [true] = StatusView.update,
+ [false] = function(self) self.size.y = 0 end,
+}
+
+function StatusView:update(...)
+ funcs[visible](self, ...)
+end
+
+command.add(nil, {
+ ["hide-status:toggle"] = function() visible = not visible end,
+ ["hide-status:hide"] = function() visible = false end,
+ ["hide-status:show"] = function() visible = true end,
+})