diff options
author | rxi <rxi@users.noreply.github.com> | 2020-05-01 18:56:53 +0100 |
---|---|---|
committer | rxi <rxi@users.noreply.github.com> | 2020-05-01 18:56:53 +0100 |
commit | 729168daf68170bb2216ec69008bcd66867c00da (patch) | |
tree | ed338cb10dba2e382b87b892272bb5f516fcb433 | |
parent | 378844cfbb2b7a1489a3344e2d6a996aa2aa53aa (diff) | |
download | lite-xl-plugins-729168daf68170bb2216ec69008bcd66867c00da.tar.gz lite-xl-plugins-729168daf68170bb2216ec69008bcd66867c00da.zip |
Added `hidestatus` plugin
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | plugins/hidestatus.lua | 18 |
2 files changed, 19 insertions, 0 deletions
@@ -16,6 +16,7 @@ Plugin | Description [`drawwhitespace`](plugins/drawwhitespace.lua?raw=1) | Draws tabs and spaces *([screenshot](https://user-images.githubusercontent.com/3920290/80573013-22ae5800-89f7-11ea-9895-6362a1c0abc7.png))* [`eval`](plugins/eval.lua?raw=1) | Replaces selected Lua code with its evaluated result [`gofmt`](plugins/gofmt.lua?raw=1) | Auto-formats the current go file, adds the missing imports and the missing return cases +[`hidestatus`](plugins/hidestatus.lua?raw=1) | Hides the status bar at the bottom of the window [`indentguide`](plugins/indentguide.lua?raw=1) | Adds indent guides *([screenshot](https://user-images.githubusercontent.com/3920290/79640716-f9860000-818a-11ea-9c3b-26d10dd0e0c0.png))* [`language_cpp`](plugins/language_cpp.lua?raw=1) | Syntax for the [C++](https://isocpp.org/) programming language [`language_fe`](plugins/language_fe.lua?raw=1) | Syntax for the [fe](https://github.com/rxi/fe) programming language 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, +}) |