diff options
| author | TJ DeVries <devries.timothyj@gmail.com> | 2021-03-17 20:04:39 -0400 |
|---|---|---|
| committer | TJ DeVries <devries.timothyj@gmail.com> | 2021-03-17 20:04:39 -0400 |
| commit | c50eaf5c9ad0a2db4e9403625df84ace4a51187b (patch) | |
| tree | 7a9e638daadbf56cf330e247d71d89f6dc6b967b /lua | |
| parent | 812fae1d718e276e18784a0d054b16d39ba0208c (diff) | |
fix: Do not error with clearing namespace on clearing display
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/telescope/pickers/highlights.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lua/telescope/pickers/highlights.lua b/lua/telescope/pickers/highlights.lua index bbb06e4..2b6abfe 100644 --- a/lua/telescope/pickers/highlights.lua +++ b/lua/telescope/pickers/highlights.lua @@ -41,6 +41,14 @@ function Highlighter:hi_display(row, prefix, display_highlights) end function Highlighter:clear_display() + if not self + or not self.picker + or not self.picker.results_bufnr + or not vim.api.nvim_buf_is_valid(self.picker.results_bufnr) + then + return + end + a.nvim_buf_clear_namespace(self.picker.results_bufnr, ns_telescope_entry, 0, -1) end |
