From fe7dec63396c40a413db192f2374f74e0eed9d78 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Wed, 9 Sep 2020 00:18:43 -0400 Subject: [PATCH] fix: don't accidentally mess with state --- lua/telescope/previewers.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/telescope/previewers.lua b/lua/telescope/previewers.lua index 44c1f09..3f0713d 100644 --- a/lua/telescope/previewers.lua +++ b/lua/telescope/previewers.lua @@ -185,6 +185,10 @@ previewers.cat = defaulter(function(opts) end, teardown = function(self) + if not self.state then + return + end + if self.state.termopen_id then pcall(vim.fn.chanclose, self.state.termopen_id) end