Skip to content

Commit c04bd96

Browse files
benlubasvhyrro
authored andcommitted
feat: support ranges in Neorg command,
1 parent 8b59db7 commit c04bd96

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lua/neorg/modules/core/neorgcmd/module.lua

+4-1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ module.load = function()
9797
vim.api.nvim_create_user_command("Neorg", module.private.command_callback, {
9898
nargs = "*",
9999
complete = module.private.generate_completions,
100+
range = 2,
100101
})
101102

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

299+
local content = vim.list_slice(args, argument_index + 1)
300+
content["data"] = data
298301
modules.broadcast_event(
299302
assert(
300303
modules.create_event(
301304
module,
302305
table.concat({ "core.neorgcmd.events.", ref.name }),
303-
vim.list_slice(args, argument_index + 1)
306+
content
304307
)
305308
)
306309
)

0 commit comments

Comments
 (0)