From 8f53e51ff8ee30c70e62ca89a4a2f5b0000650fb Mon Sep 17 00:00:00 2001 From: Ondrej Brablc Date: Mon, 18 Nov 2024 20:11:43 +0100 Subject: [PATCH] Fix yq parsing for version 4.x Apparently the depracation warning about `-j` does not get ignored, but mixed to the output. We have to use `vim.system` instead (Neovim 0.9+). --- lua/gh-actions/yaml.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/gh-actions/yaml.lua b/lua/gh-actions/yaml.lua index a64ceec..9a6abad 100644 --- a/lua/gh-actions/yaml.lua +++ b/lua/gh-actions/yaml.lua @@ -17,7 +17,13 @@ function M.parse_yaml(yamlstr) if has_rust_module then return rust.parse_yaml(yamlstr or '') else - return vim.json.decode(vim.fn.system({ 'yq', '-j' }, yamlstr)) + local result = vim + .system({ 'yq', '-j' }, { + stdin = yamlstr, + stderr = false, + }) + :wait() + return vim.json.decode(result.stdout) end end