aboutsummaryrefslogtreecommitdiff
path: root/plugins/exec.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/exec.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/exec.lua')
-rw-r--r--plugins/exec.lua26
1 files changed, 15 insertions, 11 deletions
diff --git a/plugins/exec.lua b/plugins/exec.lua
index 29c8e85..b8f61c5 100644
--- a/plugins/exec.lua
+++ b/plugins/exec.lua
@@ -28,19 +28,23 @@ end
command.add("core.docview", {
["exec:insert"] = function()
- core.command_view:enter("Insert Result Of Command", function(cmd)
- core.active_view.doc:text_input(exec(cmd))
- end)
+ core.command_view:enter("Insert Result Of Command", {
+ submit = function(cmd)
+ core.active_view.doc:text_input(exec(cmd))
+ end
+ })
end,
["exec:replace"] = function()
- core.command_view:enter("Replace With Result Of Command", function(cmd)
- core.active_view.doc:replace(function(str)
- return exec(
- "printf %b " .. printfb_quote(str:gsub("%\n$", "") .. "\n") .. " | eval '' " .. shell_quote(cmd),
- str:find("%\n$")
- )
- end)
- end)
+ core.command_view:enter("Replace With Result Of Command", {
+ submit = function(cmd)
+ core.active_view.doc:replace(function(str)
+ return exec(
+ "printf %b " .. printfb_quote(str:gsub("%\n$", "") .. "\n") .. " | eval '' " .. shell_quote(cmd),
+ str:find("%\n$")
+ )
+ end)
+ end
+ })
end,
})