fix: Do not error with clearing namespace on clearing display

This commit is contained in:
TJ DeVries
2021-03-17 20:04:39 -04:00
parent 812fae1d71
commit c50eaf5c9a

View File

@@ -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