diff options
author | jgmdev <jgmdev@gmail.com> | 2022-05-24 19:29:50 -0400 |
---|---|---|
committer | jgmdev <jgmdev@gmail.com> | 2022-05-24 19:29:50 -0400 |
commit | 35e947d1933613bb0b5a1488bf0fa4587f98ef7d (patch) | |
tree | 07d2515f44db03b1e865f6aef6adfd12b118890b /plugins/autosave.lua | |
parent | c1f3671e2a8defbc67d1e77c72d5866f2825cdb5 (diff) | |
download | lite-xl-plugins-35e947d1933613bb0b5a1488bf0fa4587f98ef7d.tar.gz lite-xl-plugins-35e947d1933613bb0b5a1488bf0fa4587f98ef7d.zip |
added config_spec and other plugin compatibility fixes.
Diffstat (limited to 'plugins/autosave.lua')
-rw-r--r-- | plugins/autosave.lua | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/plugins/autosave.lua b/plugins/autosave.lua index 34d2ad6..7691e5a 100644 --- a/plugins/autosave.lua +++ b/plugins/autosave.lua @@ -9,8 +9,24 @@ local last_keypress = os.time() -- this exists so that we don't end up with multiple copies of the loop running at once local looping = false local on_text_change = Doc.on_text_change --- the approximate amount of time, in seconds, that it takes to trigger an autosave -config.plugins.autosave = common.merge({ timeout = 1 }, config.plugins.autosave) + +config.plugins.autosave = common.merge({ + -- the approximate amount of time, in seconds, that it takes to trigger an autosave + timeout = 1, + -- The config specification used by the settings gui + config_spec = { + name = "Auto Save", + { + label = "Timeout", + description = "Approximate amount of time in seconds it takes to trigger an autosave.", + path = "timeout", + type = "number", + default = 1, + min = 1, + max = 30 + } + } +}, config.plugins.autosave) local function loop_for_save() |