Skip to content

There are two [No Name] buffer on the start #305

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
nyngwang opened this issue Apr 18, 2022 · 11 comments
Closed

There are two [No Name] buffer on the start #305

nyngwang opened this issue Apr 18, 2022 · 11 comments
Labels
bug Something isn't working

Comments

@nyngwang
Copy link

As title. I use nvim . to start neovim from the current directory. It seems that this has been mentioned by people before but I forgot the keyword(s) to find the issue.

@cseickel
Copy link
Contributor

I don't think those are from neo-tree. When I open with nvim . I end up with a single buffer named:

neo-tree filesystem [1000]

@nyngwang
Copy link
Author

nyngwang commented Apr 18, 2022

@cseickel: You might want to take a look. To make it clear, I stop the recording at the last moment when the content of neo-tree floating window was about to be shown. These three buffers are:

  1. current working directory as CWD/. This one will disappear after the content of neo-tree gets shown.
  2. [No Name]
  3. [No Name]

And I assume this is related to neo-tree because this didn't happen some months before, and I didn't install any other file-tree-related plugins.

demo.mov

@cseickel
Copy link
Contributor

I think those extra buffers being displayed are the result of whatever tabline plugin you are using being out of sync. Run the :ls command to see if those buffers really exist. If you have neo-tree opening as a sidebar, then there should be exactly one [No Name] buffer when it finishes the netrw hijack.

@nyngwang
Copy link
Author

@cseickel:

I got this:

[...] whatever tabline plugin you are using being out of sync. [...]

OK, this is possible. I'm using https://github.com/akinsho/bufferline.nvim, but I don't know how to check it. Do you also use this plugin?

@cseickel
Copy link
Contributor

If it is showing the extra [No Name] with :ls then they are really there and it's probably not a problem with bufferline at all. I would still think it is a conflict with another plugin though.

@cseickel
Copy link
Contributor

Actually, I take it back. I get the same thing when I change the default position to "float". I'll take a look.

@cseickel cseickel added the bug Something isn't working label Apr 18, 2022
@nyngwang
Copy link
Author

@cseickel: Really thank you! If you're busy with the other things it's OK to fix this after them, since I just made a little hot-fix for it.

@nyngwang
Copy link
Author

nyngwang commented Apr 19, 2022

I suspect that this would cause a related problem in integrating with fzf-lua(ibhagwan/fzf-lua#390). But it's also possible that this is related to the bufferline.nvim plugin.

The explanation for the following demo: If I change it from float to right then the buffer did get "shown", but the buffer is not listed, so there are only two [No Name] buffers in the demo:

debug_2.mov

Current workaround:

vim.keymap.set('n', ';', function ()
  if vim.bo.filetype ~= 'neo-tree' then
    vim.cmd('NeoNoNameClean') -- This will merge those `[No Name]` buffers into a single one
  end
  vim.cmd('Neotree float toggle reveal_force_cwd dir=' .. vim.fn.getcwd())
  if vim.bo.filetype ~= 'neo-tree'
    and not vim.api.nvim_buf_get_option(0, 'buflisted') then
      vim.cmd('set buflisted') -- This will set the current buffer the one selected by fzf-lua.
  end
end, NOREF_NOERR_TRUNC)

@nyngwang
Copy link
Author

nyngwang commented Apr 21, 2022

@cseickel: Could you prioritize the fix of this issue? I assume the fix would be not that complicated. I encountered many little bugs related to this when interacting with some other plugins. Sorry for being hurry.

@cseickel
Copy link
Contributor

@nyngwang I think this is fixed in main, give it a try and let me know if it is working for you.

@nyngwang
Copy link
Author

nyngwang commented Apr 21, 2022

@cseickel: Perfect! Let me close it now!

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