This is mostly for built-in operators or integrations where you dont have control over operator.
Right now this possible only with manually overriding after hook which is inconvenient for built-ins/third-party integrations.
Also there are no way to get all available operators. occurrence.api ok for built-ins
just in case anyone else want built-ins but with dispose after operator
local api = require("occurrence.api")
-- filter api because have keymaps there too!
local actions = vim.tbl_map(function(item)
if item.operator ~= nil then
return item
end
end, api)
actions = vim.tbl_map(function(action)
local after = action.after
action.after = function(marks, ctx)
if after then
after(marks, ctx)
end
ctx.occurrence:dispose()
end
return action
end, actions)
require("occurrence").setup({
operators = actions,
})
This is mostly for built-in operators or integrations where you dont have control over operator.
Right now this possible only with manually overriding after hook which is inconvenient for built-ins/third-party integrations.
Also there are no way to get all available operators.
occurrence.apiok for built-insjust in case anyone else want built-ins but with dispose after operator