diff options
author | Guldoman <giulio.lettieri@gmail.com> | 2022-11-02 08:10:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-02 08:10:57 +0100 |
commit | 9bf5649c7df6bbd746956e9a96b616f61a59fa9b (patch) | |
tree | 725e2d12dc826f8ebe73807a705371cb4c5af4d9 /plugins/datetimestamps.lua | |
parent | 49139e03398c9d0ecb347267a4882a4eb3f7ee23 (diff) | |
download | lite-xl-plugins-9bf5649c7df6bbd746956e9a96b616f61a59fa9b.tar.gz lite-xl-plugins-9bf5649c7df6bbd746956e9a96b616f61a59fa9b.zip |
Use new `command.add` syntax (#136)
Diffstat (limited to 'plugins/datetimestamps.lua')
-rw-r--r-- | plugins/datetimestamps.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/datetimestamps.lua b/plugins/datetimestamps.lua index f16af83..4867c08 100644 --- a/plugins/datetimestamps.lua +++ b/plugins/datetimestamps.lua @@ -57,29 +57,29 @@ config.plugins.datetimestamps = common.merge({ } }, config.plugins.datetimestamps) -local function datestamp() +local function datestamp(dv) local sOut = os.date(config.plugins.datetimestamps.format_datestamp) - core.active_view.doc:text_input(sOut) + dv.doc:text_input(sOut) end -local function datetimestamp() +local function datetimestamp(dv) local sOut = os.date(config.plugins.datetimestamps.format_datetimestamp) - core.active_view.doc:text_input(sOut) + dv.doc:text_input(sOut) end -local function timestamp() +local function timestamp(dv) local sOut = os.date(config.plugins.datetimestamps.format_timestamp) - core.active_view.doc:text_input(sOut) + dv.doc:text_input(sOut) end command.add("core.docview", { ["datetimestamps:insert-datestamp"] = datestamp, ["datetimestamps:insert-timestamp"] = timestamp, ["datetimestamps:insert-datetimestamp"] = datetimestamp, - ["datetimestamps:insert-custom"] = function() + ["datetimestamps:insert-custom"] = function(dv) core.command_view:enter("Date format eg: %H:%M:%S", { submit = function(cmd) - core.active_view.doc:text_input(os.date(cmd) or "") + dv.doc:text_input(os.date(cmd) or "") end }) end, |