Skip to content

BUG: Currently open buffers list only update if the file has been opened by neotree #1124

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

Closed
3 tasks done
Zeioth opened this issue Aug 28, 2023 · 2 comments
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@Zeioth
Copy link

Zeioth commented Aug 28, 2023

Did you check docs and existing issues?

  • I have read all the docs.
  • I have searched the existing issues.
  • I have searched the existing discussions.

Neovim Version (nvim -v)

0.9.1

Operating System / Version

Arch btw

Describe the Bug

When opening several buffers at the same time with Rnvimr, or any other way, the Bufs tab is not updated with the opened buffers.

I've tried with

  autocmd("BufReadPre", {
    desc = "Refresh Neo-Tree buffers tab when opening a new buffer",
    group = augroup("neotree_refresh", { clear = true }),
    callback = function()
        require("neo-tree.sources.buffers").buffers_changed()
    end,
  })
  • But this only shows a buffer in the neotree buffers list after I enter the buffer.
  • I need the buffers to be added to the neotree buffers list as soon as they are opened.

How can this be done?

Screenshots, Traceback

You can see items are on the heirline but not on neotree bufs list
screenshot_2023-08-28_16-41-08_754407908

Steps to Reproduce

  1. Open Rnvimr and press space to mark several files.
  2. Press ENTER to open them

Expected Behavior

Neotree bufs tree should be updated no matter what or how open the buffers.

Your Configuration

https://github.com/NormalNvim/NormalNvim
@Zeioth Zeioth added the bug Something isn't working label Aug 28, 2023
Zeioth added a commit to NormalNvim/NormalNvim that referenced this issue Aug 28, 2023
@Zeioth Zeioth changed the title BUG: Currently open buffers list only update if the file has been opened by neotree BUG: Currently open buffers list only update if the file has been opened by neotree Aug 28, 2023
@cseickel
Copy link
Contributor

cseickel commented Aug 28, 2023

The buffers in question may not actually be loaded. Try this option:

require("neo-tree").setup({
  buffers = {
    show_unloaded = true
  }
})

show_unloaded = false, -- When working with sessions, for example, restored but unfocused buffers
-- are mark as "unloaded". Turn this on to view these unloaded buffer.

@Zeioth
Copy link
Author

Zeioth commented Aug 28, 2023

Bull's eye. That fixes it thank you so much @cseickel

@Zeioth Zeioth closed this as completed Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants