Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
omerdn1 opened this issue Mar 4, 2024 · 1 comment
Open
Labels
bug Something isn't working question Further information is requested

Comments

@omerdn1
Copy link

omerdn1 commented Mar 4, 2024

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 omerdn1 added the bug Something isn't working label Mar 4, 2024
@stevearc
Copy link
Owner

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 stevearc added the question Further information is requested label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants