aboutsummaryrefslogtreecommitdiff
path: root/plugins/eval.lua
diff options
context:
space:
mode:
authorjgmdev <jgmdev@gmail.com>2022-06-16 00:32:07 -0400
committerjgmdev <jgmdev@gmail.com>2022-06-16 00:32:07 -0400
commit49fc493834c9b450ed102e261e65577a88291008 (patch)
treedd30ac8d0b4952f7a7499b9583d327a30656571f /plugins/eval.lua
parentd8fbb5ea0c65e01c441e7b9917dcb97da60e8f2b (diff)
downloadlite-xl-plugins-49fc493834c9b450ed102e261e65577a88291008.tar.gz
lite-xl-plugins-49fc493834c9b450ed102e261e65577a88291008.zip
updates to new command_view:enter interface
Diffstat (limited to 'plugins/eval.lua')
-rw-r--r--plugins/eval.lua20
1 files changed, 12 insertions, 8 deletions
diff --git a/plugins/eval.lua b/plugins/eval.lua
index 36cc714..c2eb19e 100644
--- a/plugins/eval.lua
+++ b/plugins/eval.lua
@@ -13,16 +13,20 @@ end
command.add("core.docview", {
["eval:insert"] = function()
- core.command_view:enter("Evaluate And Insert Result", function(cmd)
- core.active_view.doc:text_input(eval(cmd))
- end)
+ core.command_view:enter("Evaluate And Insert Result", {
+ submit = function(cmd)
+ core.active_view.doc:text_input(eval(cmd))
+ end
+ })
end,
["eval:replace"] = function()
- core.command_view:enter("Evaluate And Replace With Result", function(cmd)
- core.active_view.doc:replace(function(str)
- return eval(cmd)
- end)
- end)
+ core.command_view:enter("Evaluate And Replace With Result", {
+ submit = function(cmd)
+ core.active_view.doc:replace(function(str)
+ return eval(cmd)
+ end)
+ end
+ })
end,
})