Change :Build{Dir} commands to global from buffer

This commit is contained in:
Kenneth Benzie 2024-04-02 16:22:04 +01:00
parent 61d734fbc0
commit 776fb1f204

View File

@ -151,17 +151,15 @@ function build.list_targets()
return targets return targets
end end
local buffer = vim.api.nvim_get_current_buf()
-- Create :BuildDir command -- Create :BuildDir command
vim.api.nvim_buf_create_user_command(buffer, 'BuildDir', function(opts) vim.api.nvim_create_user_command('BuildDir', function(opts)
build.set_dir(opts.fargs[1]) build.set_dir(opts.fargs[1])
end, { end, {
bang = true, nargs = '?', complete = build.list_dirs, bang = true, nargs = '?', complete = build.list_dirs,
}) })
-- Create :Build command -- Create :Build command
vim.api.nvim_buf_create_user_command(buffer, 'Build', function(opts) vim.api.nvim_create_user_command('Build', function(opts)
build.run(opts.fargs) build.run(opts.fargs)
end, { end, {
bang = true, nargs = '*', complete = build.list_targets, bang = true, nargs = '*', complete = build.list_targets,