Skip to content

Commit

Permalink
docs(core.dirman): fix type errors related to events
Browse files Browse the repository at this point in the history
`assert()`s are used as there is no reason for the code to fail given the context.
  • Loading branch information
vhyrro committed Jan 6, 2024
1 parent f71bf74 commit 8eeca6d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/neorg/modules/core/dirman/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ module.public = {

-- Broadcast the workspace_changed event with all the necessary information
modules.broadcast_event(
modules.create_event(
assert(modules.create_event(
module,
"core.dirman.events.workspace_changed",
{ old = current_ws, new = new_workspace }
)
))
)

return true
Expand All @@ -204,7 +204,7 @@ module.public = {
module.config.public.workspaces[workspace_name] = workspace_path
-- Broadcast the workspace_added event with the newly added workspace as the content
modules.broadcast_event(
modules.create_event(module, "core.dirman.events.workspace_added", { workspace_name, workspace_path })
assert(modules.create_event(module, "core.dirman.events.workspace_added", { workspace_name, workspace_path }))
)

-- Sync autocompletions so the user can see the new workspace
Expand Down Expand Up @@ -333,7 +333,7 @@ module.public = {

local bufnr = module.public.get_file_bufnr(fname)
modules.broadcast_event(
modules.create_event(module, "core.dirman.events.file_created", { buffer = bufnr, opts = opts })
assert(modules.create_event(module, "core.dirman.events.file_created", { buffer = bufnr, opts = opts }))
)

if not opts.no_open then
Expand Down

0 comments on commit 8eeca6d

Please sign in to comment.