stickybuf.nvim icon indicating copy to clipboard operation
stickybuf.nvim copied to clipboard

bug: get_auto_pin doesn't seem to pick up on Lazy's float window

Open omerdn1 opened this issue 1 year ago • 1 comments

Neovim version (nvim -v)

0.9.5

Operating system/version

Macos

Describe the bug

Hi, love this plugin!

I was trying to fix an annoying behavior when using lazy + sessions.

Basically, if you reopen nvim and have an active session, the lazy float buffer will result to opening the other buffer in the float window.

I was trying to fix this like so:

          get_auto_pin = function(bufnr)
            if vim.bo[bufnr].filetype == 'lazy' then
              return true
            end
            return require('stickybuf').should_auto_pin(bufnr)
          end,

But the problem is the lazy buffer is not being picked up by the underlying BufEnter. I know that lazy is doing a lot with that buffer (it's hidden, unlisted, etc..), so that is possibly the reason.

Is there a way to still apply pin buffer to the lazy buffer?

What is the severity of this bug?

minor (annoyance)

Steps To Reproduce

Use a session manager, add a new plugin to lazy. Have a file open. Reopen neovim.

omerdn1 avatar Mar 04 '24 22:03 omerdn1

It's possible that the Lazy window is being opened and entered before stickybuf has loaded and created its autocmds. You could try manually adding a filetype autocmd early in your config to pin the lazy buffer (using :PinBuffer or require("stickybuf").pin())

stevearc avatar May 14 '24 04:05 stevearc