@@ -90,14 +90,13 @@ The venerable vim-dispatch provides several commands, but the main `:Make` comma
90
90
91
91
``` lua
92
92
vim .api .nvim_create_user_command (" Make" , function (params )
93
- local args = vim .fn .expandcmd (params .args )
94
93
-- Insert args at the '$*' in the makeprg
95
- local cmd , num_subs = vim .o .makeprg :gsub (" %$%*" , args )
94
+ local cmd , num_subs = vim .o .makeprg :gsub (" %$%*" , params . args )
96
95
if num_subs == 0 then
97
- cmd = cmd .. " " .. args
96
+ cmd = cmd .. " " .. params . args
98
97
end
99
98
local task = require (" overseer" ).new_task ({
100
- cmd = cmd ,
99
+ cmd = vim . fn . expandcmd ( cmd ) ,
101
100
components = {
102
101
{ " on_output_quickfix" , open = not params .bang , open_height = 8 },
103
102
" default" ,
@@ -117,14 +116,13 @@ We can run `:grep` asynchronously, similar to what we did with `:make` in the ex
117
116
118
117
``` lua
119
118
vim .api .nvim_create_user_command (" Grep" , function (params )
120
- local args = vim .fn .expandcmd (params .args )
121
119
-- Insert args at the '$*' in the grepprg
122
- local cmd , num_subs = vim .o .grepprg :gsub (" %$%*" , args )
120
+ local cmd , num_subs = vim .o .grepprg :gsub (" %$%*" , params . args )
123
121
if num_subs == 0 then
124
- cmd = cmd .. " " .. args
122
+ cmd = cmd .. " " .. params . args
125
123
end
126
124
local task = overseer .new_task ({
127
- cmd = cmd ,
125
+ cmd = vim . fn . expandcmd ( cmd ) ,
128
126
components = {
129
127
{
130
128
" on_output_quickfix" ,
0 commit comments