diff options
| author | Fahad RIaz <fahadbr@users.noreply.github.com> | 2020-09-23 00:19:14 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-23 00:19:14 -0400 |
| commit | 7015596711323127fd11c6f53e3f1fb3a51ed18e (patch) | |
| tree | 6a32b5c39b376f9f7356759c7470b2e2720dac27 /lua | |
| parent | 8f8d6563c093e8753bff4b5d66484d0291293a48 (diff) | |
fix: adding a nil check to self.state when the window is too narrow for a preview (#110)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/telescope/previewers.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lua/telescope/previewers.lua b/lua/telescope/previewers.lua index bb8b3dc..2b38a99 100644 --- a/lua/telescope/previewers.lua +++ b/lua/telescope/previewers.lua @@ -241,7 +241,7 @@ previewers.vim_buffer = defaulter(function(_) setup = function() return { last_set_bufnr = nil } end, teardown = function(self) - if self.state.last_set_bufnr then + if self.state and self.state.last_set_bufnr then vim.api.nvim_buf_clear_namespace(self.state.last_set_bufnr, previewer_ns, 0, -1) end end, |
