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/eval.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/eval.lua')
-rw-r--r-- | plugins/eval.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/eval.lua b/plugins/eval.lua index c2eb19e..1f507fb 100644 --- a/plugins/eval.lua +++ b/plugins/eval.lua @@ -12,18 +12,18 @@ end command.add("core.docview", { - ["eval:insert"] = function() + ["eval:insert"] = function(dv) core.command_view:enter("Evaluate And Insert Result", { submit = function(cmd) - core.active_view.doc:text_input(eval(cmd)) + dv.doc:text_input(eval(cmd)) end }) end, - ["eval:replace"] = function() + ["eval:replace"] = function(dv) core.command_view:enter("Evaluate And Replace With Result", { submit = function(cmd) - core.active_view.doc:replace(function(str) + dv.doc:replace(function(str) return eval(cmd) end) end |