Skip to content

Commit

Permalink
chore: autoformat with stylua
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro authored and github-actions[bot] committed Jan 6, 2024
1 parent 26cfe0e commit f4acc8e
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 30 deletions.
12 changes: 7 additions & 5 deletions lua/neorg/modules/core/keybinds/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,14 @@ module.on_event = function(event)
-- If it is defined then broadcast the event
if module.events.defined[keybind_event_path] then
modules.broadcast_event(
assert(modules.create_event(
module,
"core.keybinds.events." .. keybind_event_path,
vim.list_slice(event.content, 3)
assert(
modules.create_event(
module,
"core.keybinds.events." .. keybind_event_path,
vim.list_slice(event.content, 3)
)
)
))
)
else -- Otherwise throw an error
log.error("Unable to trigger keybind", keybind_event_path, "- the keybind does not exist")
end
Expand Down
24 changes: 14 additions & 10 deletions lua/neorg/modules/core/mode/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ module.public = {

-- Broadcast the mode_created event
modules.broadcast_event(
assert(modules.create_event(
module,
"core.mode.events.mode_created",
{ current = module.config.public.current_mode, new = mode_name }
))
assert(
modules.create_event(
module,
"core.mode.events.mode_created",
{ current = module.config.public.current_mode, new = mode_name }
)
)
)

-- Define the autocompletion tables and make them include the current mode
Expand Down Expand Up @@ -105,11 +107,13 @@ module.public = {

-- Broadcast the mode_set event to all subscribed modules
modules.broadcast_event(
assert(modules.create_event(
module,
"core.mode.events.mode_set",
{ current = module.config.public.previous_mode, new = mode_name }
))
assert(
modules.create_event(
module,
"core.mode.events.mode_set",
{ current = module.config.public.previous_mode, new = mode_name }
)
)
)
end,

Expand Down
12 changes: 7 additions & 5 deletions lua/neorg/modules/core/neorgcmd/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,13 @@ module.private = {
end

modules.broadcast_event(
assert(modules.create_event(
module,
table.concat({ "core.neorgcmd.events.", ref.name }),
vim.list_slice(args, argument_index + 1)
))
assert(
modules.create_event(
module,
table.concat({ "core.neorgcmd.events.", ref.name }),
vim.list_slice(args, argument_index + 1)
)
)
)
end,

Expand Down
24 changes: 14 additions & 10 deletions lua/neorg/modules/core/promo/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,13 @@ module.on_event = neorg.utils.wrap_dotrepeat(function(event)

if modules.loaded_modules["core.concealer"] then
modules.broadcast_event(
assert(modules.create_event(
modules.loaded_modules["core.concealer"],
"core.concealer.events.update_region",
{ start = start_pos[1] - 1, ["end"] = end_pos[1] + 2 }
))
assert(
modules.create_event(
modules.loaded_modules["core.concealer"],
"core.concealer.events.update_region",
{ start = start_pos[1] - 1, ["end"] = end_pos[1] + 2 }
)
)
)
end
elseif event.split_type[2] == "core.promo.demote_range" then
Expand All @@ -341,11 +343,13 @@ module.on_event = neorg.utils.wrap_dotrepeat(function(event)

if modules.loaded_modules["core.concealer"] then
modules.broadcast_event(
assert(modules.create_event(
modules.loaded_modules["core.concealer"],
"core.concealer.events.update_region",
{ start = start_pos[1] - 1, ["end"] = end_pos[1] + 2 }
))
assert(
modules.create_event(
modules.loaded_modules["core.concealer"],
"core.concealer.events.update_region",
{ start = start_pos[1] - 1, ["end"] = end_pos[1] + 2 }
)
)
)
end
end
Expand Down

0 comments on commit f4acc8e

Please sign in to comment.