From d7ecc096e5c8cc64611cad681a2d821f5547d2f2 Mon Sep 17 00:00:00 2001 From: hrsh7th Date: Mon, 9 Aug 2021 13:35:15 +0900 Subject: [PATCH] Fix #3 --- lua/cmp/float.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lua/cmp/float.lua b/lua/cmp/float.lua index 20efe1d..7755d1c 100644 --- a/lua/cmp/float.lua +++ b/lua/cmp/float.lua @@ -22,17 +22,20 @@ float.show = function(self, e) float.close.stop() local documentation = config.get().documentation + if not documentation then + return + end -- update buffer content if needed. if not self.entry or e.id ~= self.entry.id then - self.entry = e - self.buf = vim.api.nvim_create_buf(true, true) - vim.api.nvim_buf_set_option(self.buf, 'bufhidden', 'wipe') - local documents = e:get_documentation() if #documents == 0 then return self:close() end + + self.entry = e + self.buf = vim.api.nvim_create_buf(false, true) + vim.api.nvim_buf_set_option(self.buf, 'bufhidden', 'wipe') vim.lsp.util.stylize_markdown(self.buf, documents, { max_width = documentation.maxwidth, max_height = documentation.maxheight,