diff options
Diffstat (limited to 'plugins/datetimestamps.lua')
-rw-r--r-- | plugins/datetimestamps.lua | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/plugins/datetimestamps.lua b/plugins/datetimestamps.lua index 9ce425a..51d698e 100644 --- a/plugins/datetimestamps.lua +++ b/plugins/datetimestamps.lua @@ -1,4 +1,4 @@ --- mod-version:1 -- lite-xl 1.16 +-- mod-version:2 -- lite-xl 2.0 local core = require "core" local config = require "core.config" local command = require "core.command" @@ -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", { |