Skip to content

Commit d3f19a5

Browse files
committed
refactor(plugin): move module references user command callbacks
1 parent 13ac3ed commit d3f19a5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

plugin/please.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,18 @@ local function complete_arg(prefix, candidates)
4242
return result
4343
end
4444

45-
local cmds = please
4645
---@type table<string, string[]>
4746
local cmd_opts = {
4847
test = { 'under_cursor' },
4948
debug = { 'under_cursor' },
5049
}
5150
local var_arg_cmds = { 'command' }
5251

53-
local cmd_names = vim.tbl_keys(cmds)
5452
vim.api.nvim_create_user_command('Please', function(args)
5553
local cmd_name = args.fargs[1]
5654
local cmd_args = { unpack(args.fargs, 2) }
5755

58-
local cmd = cmds[cmd_name]
56+
local cmd = please[cmd_name]
5957
if not cmd then
6058
logging.error("'%s' is not a 'Please' command", cmd_name)
6159
return
@@ -93,7 +91,7 @@ end, {
9391
-- If there's only two words in the command line, then we're completing the command name. i.e. If cmd_line looks
9492
-- like 'Please te'.
9593
if #cmd_line_words == 2 then
96-
return complete_arg(arg_lead, cmd_names)
94+
return complete_arg(arg_lead, vim.tbl_keys(please))
9795
end
9896

9997
-- cmd_line looks like 'Please test ...'

0 commit comments

Comments
 (0)