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.
This commit is contained in:
Barrett Ruth 2026-03-06 11:37:28 -05:00
parent c3de0004d1
commit a078bcf53c
Signed by: barrett
GPG key ID: A6C96C9349D2FC81

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