From a078bcf53c575c5df023dce9584c81d088683840 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Fri, 6 Mar 2026 11:37:28 -0500 Subject: [PATCH] fix: restore `buflisted` on jumplist buffer re-entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 `` and `` 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. --- lua/canola/init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/canola/init.lua b/lua/canola/init.lua index 5d6d06a..a728bdb 100644 --- a/lua/canola/init.lua +++ b/lua/canola/init.lua @@ -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