Skip to content

Commit 90da838

Browse files
authored
Merge pull request #227 from Isrothy/event-group
fix: Use correct group for user events
2 parents 424f1df + 8bacc1b commit 90da838

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

lua/neominimap/events/mark.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55

66
local api, fn = vim.api, vim.fn
77

8-
local group = api.nvim_create_augroup("NeominimapMark", {})
9-
108
--- @param data any
119
local function exec_autocmd(data)
1210
api.nvim_exec_autocmds("User", {
1311
pattern = "Mark",
1412
data = data,
13+
group = "Neominimap",
1514
})
1615
end
1716

@@ -52,6 +51,7 @@ return function(key)
5251
mark_set_keymap(key, string.char(code))
5352
end
5453

54+
local group = api.nvim_create_augroup("NeominimapMark", {})
5555
for _, cmd in ipairs({ "k", "mar", "delm" }) do
5656
on_cmd(cmd, group, function()
5757
exec_autocmd({ cmd = cmd })

lua/neominimap/events/search.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111

1212
local api, fn = vim.api, vim.fn
1313

14-
local group = api.nvim_create_augroup("NeominimapSearch", {})
15-
1614
--- @param data any
1715
local function exec_autocmd(data)
1816
api.nvim_exec_autocmds("User", {
1917
pattern = "Search",
2018
data = data,
19+
group = "Neominimap",
2120
})
2221
end
2322

@@ -45,7 +44,7 @@ vim.on_key(function(key)
4544
end)
4645

4746
api.nvim_create_autocmd({ "CmdlineEnter", "CmdLineChanged", "CmdlineLeave" }, {
48-
group = group,
47+
group = api.nvim_create_augroup("NeominimapSearch", {}),
4948
callback = function()
5049
if require("neominimap.util").is_search_mode() then
5150
exec_autocmd({ pattern = fn.getcmdline() })

lua/neominimap/map/handlers/builtins/init.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,10 @@ return {
136136
event = "User",
137137
opts = {
138138
pattern = "Mark",
139+
group = "NeominimapMark",
139140
desc = "Update marks annotations when mark event is triggered",
140141
callback = function(apply, args)
142+
local logger = require("neominimap.logger")
141143
require("neominimap.map.handlers.builtins.mark").on_mark(apply, args)
142144
end,
143145
},

0 commit comments

Comments
 (0)