elixir-tools / elixir-tools.nvim

Neovim plugin for Elixir
MIT License
395 stars 29 forks source link

fix: receive correct json responses from curl #173

Closed johannesrld closed 9 months ago

johannesrld commented 9 months ago

This fixes the issue I encountered in #172 on my end at least, vim.fn has no docs whatsoever so I had to scour other plugins to figure out how to use it:(\ Closes #172

mhanberg commented 9 months ago

Can you elaborate on how this fixes the error you saw?

johannesrld commented 9 months ago

Can you elaborate on how this fixes the error you saw?

vim.fn.system maps to vims system() function, passing a string directly into the function runs the command on the users $SHELL, if your $SHELL is not posix compliant (mine is fish) it might cause issues, passing a list (or a table in luas case) runs the command directly without the shell. :help system() has more details

(I didn't know this until I looked it up, all I knew when I submitted the PR was that vim.fn.system was failing, so I looked up how other people were using on github it and noticed that most were using a table instead of a raw string, so I tried that and it worked)

edit: stylua formatting commit happened after this comment, WSL has an issue with its clock so it drifts after a little bit, apologies.

johannesrld commented 9 months ago

for clarification, setting my $SHELL to bash fixes the issue as well

mhanberg commented 9 months ago

Awesome, thank you!

I'll merge as soon as I can't test this myself