From 81b5e0ae00885f355498c3dadbbc827757dc61d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Gro=C3=9F?= Date: Tue, 15 Aug 2023 23:54:20 +0200 Subject: [PATCH] Fix invalid channel usage when job is dead This makes the plugin more resistant in a fatal scenario. --- autoload/tpipeline.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autoload/tpipeline.vim b/autoload/tpipeline.vim index 5f76c09..13459a1 100644 --- a/autoload/tpipeline.vim +++ b/autoload/tpipeline.vim @@ -342,7 +342,10 @@ endfunc func tpipeline#job_state() let res = "" if s:is_nvim - let pid = jobpid(s:job) + let pid = 0 + if s:exit_code < 0 + let pid = jobpid(s:job) + endif let res = pid ? "run as PID " . pid : "dead" else let res = job_status(s:job)