fix: restore buflisted on jumplist buffer re-entry (#71)

* fix: restore `buflisted` on jumplist buffer re-entry

Problem: Neovim's jumplist machinery re-enters canola buffers via an
internal `:edit`-equivalent path, which unconditionally sets
`buflisted = true`. The existing workaround in `open()` and
`open_float()` only covers canola-initiated navigation, leaving
`<C-o>` and `<C-i>` unhandled.

Solution: Apply the same `buf_options.buflisted` guard in the
`BufEnter` autocmd, directly after `set_win_options()`. This fires
on every buffer entry — including all jumplist paths — and mirrors
the pattern already used at the two `:edit` callsites.

* docs: mark upstream #302 as fixed in tracker
This commit is contained in:
Barrett Ruth 2026-03-06 11:55:37 -05:00 committed by GitHub
parent c3de0004d1
commit 41f375ee9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -1343,6 +1343,9 @@ M.setup = function(opts)
vim.fn.setreg('#', orig_buffer)
end
view.set_win_options()
if config.buf_options.buflisted ~= nil then
vim.api.nvim_set_option_value('buflisted', config.buf_options.buflisted, { buf = 0 })
end
vim.w.canola_did_enter = true
elseif vim.fn.isdirectory(bufname) == 0 then
-- Only run this logic if we are *not* in an canola buffer (and it's not a directory, which