Skip to content

Commit

Permalink
feat: support ranges in Neorg command,
Browse files Browse the repository at this point in the history
  • Loading branch information
benlubas authored and vhyrro committed Dec 14, 2024
1 parent 8b59db7 commit c04bd96
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/neorg/modules/core/neorgcmd/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ module.load = function()
vim.api.nvim_create_user_command("Neorg", module.private.command_callback, {
nargs = "*",
complete = module.private.generate_completions,
range = 2,
})

-- Loop through all the command modules we want to load and load them
Expand Down Expand Up @@ -295,12 +296,14 @@ module.private = {
module.events.defined[ref.name] = modules.define_event(module, ref.name)
end

local content = vim.list_slice(args, argument_index + 1)
content["data"] = data
modules.broadcast_event(
assert(
modules.create_event(
module,
table.concat({ "core.neorgcmd.events.", ref.name }),
vim.list_slice(args, argument_index + 1)
content
)
)
)
Expand Down

0 comments on commit c04bd96

Please sign in to comment.