From 07964ceda2ca6507a96984426f638c37e3fc0ca2 Mon Sep 17 00:00:00 2001 From: Ondrej Brablc Date: Tue, 19 Nov 2024 09:31:56 +0100 Subject: [PATCH] fix: yq parsing for version 4.x (#16) 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