aboutsummaryrefslogtreecommitdiff
path: root/plugins/regexreplacepreview.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/regexreplacepreview.lua
parent49139e03398c9d0ecb347267a4882a4eb3f7ee23 (diff)
downloadlite-xl-plugins-9bf5649c7df6bbd746956e9a96b616f61a59fa9b.tar.gz
lite-xl-plugins-9bf5649c7df6bbd746956e9a96b616f61a59fa9b.zip
Use new `command.add` syntax (#136)
Diffstat (limited to 'plugins/regexreplacepreview.lua')
-rw-r--r--plugins/regexreplacepreview.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/regexreplacepreview.lua b/plugins/regexreplacepreview.lua
index 18d692b..dfc9e45 100644
--- a/plugins/regexreplacepreview.lua
+++ b/plugins/regexreplacepreview.lua
@@ -87,10 +87,9 @@ local function regex_replace_file(view, pattern, old_lines, raw, start_line, end
return old_lines, line_scroll ~= nil
end
-command.add("core.docview", {
- ["regex-replace-preview:find-replace-regex"] = function()
+command.add("core.docview!", {
+ ["regex-replace-preview:find-replace-regex"] = function(view)
local old_lines = {}
- local view = core.active_view
local doc = view.doc
local original_selection = { doc:get_selection(true) }
local selection = doc:has_selection() and { doc:get_selection(true) } or {}