From 0f47dcaf7e39d64cd067e090e6f2eda6326e7366 Mon Sep 17 00:00:00 2001 From: hrsh7th <629908+hrsh7th@users.noreply.github.com> Date: Thu, 4 May 2023 19:35:24 +0900 Subject: [PATCH] Add `buftype=nofile` for entries_win and docs_win - reddit user mention this... --- lua/cmp/view/custom_entries_view.lua | 1 + lua/cmp/view/docs_view.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/lua/cmp/view/custom_entries_view.lua b/lua/cmp/view/custom_entries_view.lua index bb3266f..a5eca58 100644 --- a/lua/cmp/view/custom_entries_view.lua +++ b/lua/cmp/view/custom_entries_view.lua @@ -37,6 +37,7 @@ custom_entries_view.new = function() -- from variable width of the tab character. self.entries_win:buffer_option('tabstop', 1) self.entries_win:buffer_option('filetype', 'cmp_menu') + self.entries_win:buffer_option('buftype', 'nofile') self.event = event.new() self.offset = -1 self.active = false diff --git a/lua/cmp/view/docs_view.lua b/lua/cmp/view/docs_view.lua index 7db651b..e559a53 100644 --- a/lua/cmp/view/docs_view.lua +++ b/lua/cmp/view/docs_view.lua @@ -18,6 +18,7 @@ docs_view.new = function() self.window:option('showbreak', 'NONE') self.window:option('wrap', true) self.window:buffer_option('filetype', 'cmp_docs') + self.window:buffer_option('buftype', 'nofile') return self end