Skip to content

Commit

Permalink
handle_event function
Browse files Browse the repository at this point in the history
  • Loading branch information
clpi committed Dec 29, 2024
1 parent d3fc0a1 commit 4cc953e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lua/down/mod.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
local uv, lu, fn = vim.loop or vim.uv, vim.lsp.util, vim.fn
local Event = require 'down.event'
local util = require 'down.util'
local utils = require 'down.util'
local config = require('down.config')
local log = require('down.util.log')

--- @!TODO : Change to body access where appropriate and now available to avoid complex config for end user
Expand All @@ -28,7 +25,6 @@ local Mod = {
load = function()
-- print 'default load n'
end,
test = function() end,
post_load = function()
-- print('postload' .. n)
end,
Expand Down Expand Up @@ -349,6 +345,14 @@ Mod.test = function(m)
end
end

Mod.handle_event = function(e)
for m, mod in pairs(Mod.mods) do
if mod.subscribed[e.type] then
mod.subscribed[e.type]()
end
end
end

--- @param m down.Mod.Mod
--- @param name string
--- @param body table
Expand Down

0 comments on commit 4cc953e

Please sign in to comment.