From 1cad30fcffa282c0a9199c524c821eadc24bf939 Mon Sep 17 00:00:00 2001 From: Felipe Gomes <819168+felsangom@users.noreply.github.com> Date: Fri, 5 May 2023 03:54:16 -0300 Subject: [PATCH] Added a modified=false to documentation buffer, so it can be removed without E89 errors (#1557) --- lua/cmp/view/docs_view.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/cmp/view/docs_view.lua b/lua/cmp/view/docs_view.lua index e559a53..3947e33 100644 --- a/lua/cmp/view/docs_view.lua +++ b/lua/cmp/view/docs_view.lua @@ -58,6 +58,9 @@ docs_view.open = function(self, e, view) }) end + -- Set buffer as not modified, so it can be removed without errors + vim.api.nvim_buf_set_option(self.window:get_buffer(), 'modified', false) + -- Calculate window size. local width, height = vim.lsp.util._make_floating_popup_size(vim.api.nvim_buf_get_lines(self.window:get_buffer(), 0, -1, false), { max_width = max_width - border_info.horiz,