nil check for extended args

This commit is contained in:
christianchiarulli 2021-07-18 14:10:15 -04:00
parent 11ac140eb5
commit a3f3f3b60c

View file

@ -11,9 +11,13 @@ O.formatters.filetype["javascriptreact"] = {
function() function()
local args = { "--stdin-filepath", vim.fn.fnameescape(vim.api.nvim_buf_get_name(0)) } local args = { "--stdin-filepath", vim.fn.fnameescape(vim.api.nvim_buf_get_name(0)) }
local extend_args = O.lang.tsserver.formatter.args local extend_args = O.lang.tsserver.formatter.args
if extend_args then
for i = 1, #extend_args do for i = 1, #extend_args do
table.insert(args, extend_args[i]) table.insert(args, extend_args[i])
end end
end
return { return {
exe = prettier_instance, exe = prettier_instance,
args = args, args = args,