diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2021-07-13 10:47:39 -0400 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2021-08-17 09:52:24 -0400 |
commit | 466798679e7a2889622a491c776530c06668ca9f (patch) | |
tree | c0ebb8bdc0cc940f7cce465899a126f0f79a04ba /plugins/datetimestamps.lua | |
parent | fb647f8f0d972e85ac323b12eb65edf9c56b48cb (diff) | |
download | lite-xl-plugins-466798679e7a2889622a491c776530c06668ca9f.tar.gz lite-xl-plugins-466798679e7a2889622a491c776530c06668ca9f.zip |
Namespaced plugin configs.
Diffstat (limited to 'plugins/datetimestamps.lua')
-rw-r--r-- | plugins/datetimestamps.lua | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/plugins/datetimestamps.lua b/plugins/datetimestamps.lua index 4d09e27..c1b1199 100644 --- a/plugins/datetimestamps.lua +++ b/plugins/datetimestamps.lua @@ -25,32 +25,25 @@ from https://www.lua.org/pil/22.1.html %y two-digit year (98) [00-99] %% the character `%ยด --]] -config.datetimestamps_format_datestamp = "%Y%m%d" -config.datetimestamps_format_datetimestamp = "%Y%m%d_%H%M%S" -config.datetimestamps_format_timestamp = "%H%M%S" +config.plugins.datetimestamps = { + format_datestamp = "%Y%m%d" + format_datetimestamp = "%Y%m%d_%H%M%S" + format_timestamp = "%H%M%S" +} local function datestamp() - - local sOut = os.date(config.datetimestamps_format_datestamp) - + local sOut = os.date(config.plugins.datetimestamps.format_datestamp) core.active_view.doc:text_input(sOut) - end local function datetimestamp() - - local sOut = os.date(config.datetimestamps_format_datetimestamp) - + local sOut = os.date(config.plugins.datetimestamps.format_datetimestamp) core.active_view.doc:text_input(sOut) - end local function timestamp() - - local sOut = os.date(config.datetimestamps_format_timestamp) - + local sOut = os.date(config.plugins.datetimestamps.format_timestamp) core.active_view.doc:text_input(sOut) - end command.add("core.docview", { |