aboutsummaryrefslogtreecommitdiff
path: root/plugins/exec.lua
diff options
context:
space:
mode:
authorGuldoman <giulio.lettieri@gmail.com>2022-11-02 08:10:57 +0100
committerGitHub <noreply@github.com>2022-11-02 08:10:57 +0100
commit9bf5649c7df6bbd746956e9a96b616f61a59fa9b (patch)
tree725e2d12dc826f8ebe73807a705371cb4c5af4d9 /plugins/exec.lua
parent49139e03398c9d0ecb347267a4882a4eb3f7ee23 (diff)
downloadlite-xl-plugins-9bf5649c7df6bbd746956e9a96b616f61a59fa9b.tar.gz
lite-xl-plugins-9bf5649c7df6bbd746956e9a96b616f61a59fa9b.zip
Use new `command.add` syntax (#136)
Diffstat (limited to 'plugins/exec.lua')
-rw-r--r--plugins/exec.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/exec.lua b/plugins/exec.lua
index b8f61c5..f05d2b6 100644
--- a/plugins/exec.lua
+++ b/plugins/exec.lua
@@ -27,18 +27,18 @@ end
command.add("core.docview", {
- ["exec:insert"] = function()
+ ["exec:insert"] = function(dv)
core.command_view:enter("Insert Result Of Command", {
submit = function(cmd)
- core.active_view.doc:text_input(exec(cmd))
+ dv.doc:text_input(exec(cmd))
end
})
end,
- ["exec:replace"] = function()
+ ["exec:replace"] = function(dv)
core.command_view:enter("Replace With Result Of Command", {
submit = function(cmd)
- core.active_view.doc:replace(function(str)
+ dv.doc:replace(function(str)
return exec(
"printf %b " .. printfb_quote(str:gsub("%\n$", "") .. "\n") .. " | eval '' " .. shell_quote(cmd),
str:find("%\n$")