Skip to content

Commit

Permalink
remove buffer name to fix duplicated buffer issues
Browse files Browse the repository at this point in the history
Apparently it is not possible to get 100% rid of the duplicated buffer
issue. Despite all buffers by this plugin should be wiped automatically
and also deleted manually, users still have issues. There I'll now
remove the buffer naming to prevent this issue. The former mechanisms to
clear the buffers remain in place at the buffers should not accumulate
over time. But if it happens that a buffer remains existing, it will not
interfere anymore with the new one. Due to the over buffer options this
should cause no issues to the user despite an unlisted buffer.
  • Loading branch information
weilbith committed Sep 28, 2021
1 parent dcbb842 commit 4efac33
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 6 deletions.
2 changes: 0 additions & 2 deletions lua/code_action_menu/windows/base_window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ local BaseWindow = {
window_number = -1,
window_options = nil,
buffer_number = -1,
buffer_name = 'CodeActionMenuBase',
focusable = false,
filetype = '',
namespace_id = vim.api.nvim_create_namespace('code_action_menu'),
Expand Down Expand Up @@ -40,7 +39,6 @@ end

function BaseWindow:create_buffer()
self.buffer_number = vim.api.nvim_create_buf(false, true)
vim.api.nvim_buf_set_name(self.buffer_number, self.buffer_name)
vim.api.nvim_buf_set_option(self.buffer_number, 'filetype', self.filetype)
end

Expand Down
1 change: 0 additions & 1 deletion lua/code_action_menu/windows/details_window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ function DetailsWindow:new(action)
local instance = StackingWindow:new({ action = action })
setmetatable(instance, self)
self.__index = self
self.buffer_name = 'CodeActionMenuDetails'
self.filetype = 'code-action-menu-details'
return instance
end
Expand Down
1 change: 0 additions & 1 deletion lua/code_action_menu/windows/diff_window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ function DiffWindow:new(action)
local instance = StackingWindow:new({ action = action })
setmetatable(instance, self)
self.__index = self
self.buffer_name = 'CodeActionMenuDiff'
self.filetype = 'code-action-menu-diff'
return instance
end
Expand Down
1 change: 0 additions & 1 deletion lua/code_action_menu/windows/menu_window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ function MenuWindow:new(all_actions)
setmetatable(instance, self)
self.__index = self
self.focusable = true
self.buffer_name = 'CodeActionMenuMenu'
self.filetype = 'code-action-menu-menu'
return instance
end
Expand Down
1 change: 0 additions & 1 deletion lua/code_action_menu/windows/warning_message_window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ function WarningMessageWindow:new()
local instance = BaseWindow:new()
setmetatable(instance, self)
self.__index = self
self.buffer_name = 'CodeActionMenuWarningMessage'
self.filetype = 'code-action-menu-warning-message'
return instance
end
Expand Down

0 comments on commit 4efac33

Please sign in to comment.