aboutsummaryrefslogtreecommitdiff
path: root/plugins/markers.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/markers.lua
parent49139e03398c9d0ecb347267a4882a4eb3f7ee23 (diff)
downloadlite-xl-plugins-9bf5649c7df6bbd746956e9a96b616f61a59fa9b.tar.gz
lite-xl-plugins-9bf5649c7df6bbd746956e9a96b616f61a59fa9b.zip
Use new `command.add` syntax (#136)
Diffstat (limited to 'plugins/markers.lua')
-rw-r--r--plugins/markers.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/markers.lua b/plugins/markers.lua
index e2ec68e..d1a3aae 100644
--- a/plugins/markers.lua
+++ b/plugins/markers.lua
@@ -61,9 +61,9 @@ function DocView:draw_line_gutter(line, x, y, width)
end
-command.add("core.docview", {
- ["markers:toggle-marker"] = function()
- local doc = core.active_view.doc
+command.add("core.docview!", {
+ ["markers:toggle-marker"] = function(dv)
+ local doc = dv.doc
local line = doc:get_selection()
local markers = cache[doc]
@@ -74,8 +74,8 @@ command.add("core.docview", {
end
end,
- ["markers:go-to-next-marker"] = function()
- local doc = core.active_view.doc
+ ["markers:go-to-next-marker"] = function(dv)
+ local doc = dv.doc
local line = doc:get_selection()
local markers = cache[doc]