diff options
| author | Robert Günzler <r@gnzler.io> | 2022-09-28 18:46:37 +0200 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2022-09-28 18:46:37 +0200 |
| commit | 6b41ca2bd9911d1e7264b405a2c4292c154ae384 (patch) | |
| tree | 326446a5e8c0b440bcab4afde18d31aca88232b4 | |
| parent | a8b08209a6b789cbe15e8258a46e2d5ae028aa17 (diff) | |
vim/job: try to detect makefile
| -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, |