Skip to content

fix: Potential fix (and potential bugs) - #17

Open
mikew wants to merge 1 commit into
mainfrom
potential-correctness
Open

mikew wants to merge 1 commit into
mainfrom
potential-correctness

Conversation

@mikew

@mikew mikew commented Sep 4, 2024

Copy link
Copy Markdown
Owner

No description provided.

Comment thread lua/nvim-drawer/init.lua
Comment on lines +202 to +206
-- ... or if we do have a window but don't have a buffer, we use the buffer
-- of the window.
if winid ~= -1 and bufnr == -1 then
bufnr = vim.api.nvim_win_get_buf(winid)
end

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels "technically correct": when .open is called, and somehow there is a window that belongs to the drawer but it doesn't contain a known buffer, that buffer is used.

The controversial / potential bugs bit is the fact that it happens after the logic for should_reuse_previous_bufnr happens, and that logic very intentionally defaults back to -1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant