diff options
| -rw-r--r-- | .vim/lua/job.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/.vim/lua/job.lua b/.vim/lua/job.lua index cb5e95a..f9f7bf3 100644 --- a/.vim/lua/job.lua +++ b/.vim/lua/job.lua @@ -109,12 +109,14 @@ function M.make(extra_args) local command = args[1] table.remove(args, 1) - -- detect makefile local cwd = vim.fn.expand('%:p:h') - cwd = require('lspconfig.util').root_pattern('Makefile')(cwd) - local extra_args = extra_args or {} - table.foreach(extra_args, function(_, v) table.insert(args, v) end) + if not (string.match(makeprg, 'make') == nil) then + -- detect makefile + cwd = require('lspconfig.util').root_pattern('Makefile')(cwd) + end + + table.foreach(extra_args or {}, function(_, v) table.insert(args, v) end) return M.jobstart { command = command, |