aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorThaCuber <70547062+thacuber2a03@users.noreply.github.com>2023-10-17 16:07:34 -0400
committerGitHub <noreply@github.com>2023-10-17 16:07:34 -0400
commit7608e2c2be6a0f7889147e3ef209cfd7cb617541 (patch)
treef1aefdeba1fe8728d6c9dfd1ded37fa583972a9d /plugins
parent090fe0d8954b201d9b71de3ac084a8a9bf0180b6 (diff)
downloadlite-xl-plugins-7608e2c2be6a0f7889147e3ef209cfd7cb617541.tar.gz
lite-xl-plugins-7608e2c2be6a0f7889147e3ef209cfd7cb617541.zip
add `cleanstart` plugin (#320)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/cleanstart.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/cleanstart.lua b/plugins/cleanstart.lua
new file mode 100644
index 0000000..b1f3244
--- /dev/null
+++ b/plugins/cleanstart.lua
@@ -0,0 +1,11 @@
+-- mod-version:3
+require 'plugins.treeview' -- load after treeview
+local command = require 'core.command'
+
+local close = true
+for _, v in ipairs(ARGS) do
+ local info = system.get_file_info(v)
+ if info and info.type == "dir" then close = false; break end
+end
+
+if close then command.perform "treeview:toggle" end