From 0907be547a78373a4df2907bc737c271190c4695 Mon Sep 17 00:00:00 2001 From: Marc Hamamji Date: Fri, 14 Apr 2023 23:48:44 +0300 Subject: [PATCH 1/2] Remove npm errors from nodejs handlers --- lua/runner/handlers/languages/nodejs/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/runner/handlers/languages/nodejs/init.lua b/lua/runner/handlers/languages/nodejs/init.lua index 0d9d065..184a3eb 100644 --- a/lua/runner/handlers/languages/nodejs/init.lua +++ b/lua/runner/handlers/languages/nodejs/init.lua @@ -7,7 +7,7 @@ return function(buffer) for _, line in pairs(output) do for _, data in pairs(line) do - if vim.trim(data) ~= '' then + if vim.trim(data) ~= '' and not string.match(data, 'npm ERR!') then bins[#bins + 1] = data end end From 5f0e30bc07d90a0e4edafeaaf2da669806f92e79 Mon Sep 17 00:00:00 2001 From: Marc Hamamji Date: Fri, 14 Apr 2023 23:52:18 +0300 Subject: [PATCH 2/2] Make editable optional in shell_handler docs --- lua/runner/handlers/helpers.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/runner/handlers/helpers.lua b/lua/runner/handlers/helpers.lua index 1d26cf2..daa68d7 100644 --- a/lua/runner/handlers/helpers.lua +++ b/lua/runner/handlers/helpers.lua @@ -22,7 +22,7 @@ local M = {} --- ``` --- --- @param command string The shell command to run when the handler called ---- @param editable boolean Whether the user should be prompted to edit the command using `vim.input()` before running it. Useful when giving command line arguments to a script +--- @param editable boolean? Whether the user should be prompted to edit the command using `vim.input()` before running it. Useful when giving command line arguments to a script. *Defaults to false* M.shell_handler = function(command, editable) if editable == nil then editable = false