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

barbar causes redraw on startup which removes startup screen

Open advay168 opened this issue 2 years ago • 4 comments
trafficstars

Description After I updated barbar to master, whenever I open neovim, I see the startup screen flash and then disappear. I was able to bisect the history to determine https://github.com/romgrk/barbar.nvim/commit/d0b39de8ce48e9efced88edc9244ca21e571bb98 is where this issue starts from. I have been able to make a temporary fix by disabling icons with the viml setup variable. It does not work if I disable icons in lua setup which I guess is because of the auto setup. Nevertheless, this fix requires turning icons off which I would like to avoid.

To Reproduce init.lua:

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
vim.opt.rtp:prepend(lazypath)
-- vim.g.bufferline = {icons=false} -- uncommenting this line fixes issue but disables icons
require("lazy").setup({
  {
    'romgrk/barbar.nvim',
    dependencies = { "nvim-tree/nvim-web-devicons" },
  },
})

Steps to reproduce the behavior:

  1. Launch neovim
  2. Startup screen flashes on the screen and disappears
  3. Disable icons with vim.g.bufferline = {icons=false}
  4. Startup screen appears and stays

Screenshots If applicable, add screenshots to help explain your problem or to capture error messages.

Information Neovim version: 0.8.1

advay168 avatar Apr 05 '23 09:04 advay168

@romgrk do we care about fixing this? Half of the plugins I use clear the startup screen; I haven't seen it in so long I forgot what it looked like.

If it was clearing a startup screen from a plugin I'd be concerned, but the Nvim startup screen doesn't have interactivity.

It does not work if I disable icons in lua setup which I guess is because of the auto setup

Related: #431, #438

Iron-E avatar Apr 05 '23 15:04 Iron-E

I also haven't seen it in forever. My approach for many of these issues is, if someone has time & interest and provides a good PR I'm fine with merging, but I won't fix this myself.

romgrk avatar Apr 05 '23 17:04 romgrk

For what it's worth, this bug seems to also overwrite the "greeter" shown by alpha-nvim which seems to be well liked.

AidanJHMurphy avatar Oct 22 '23 23:10 AidanJHMurphy

For what it's worth, this bug seems to also overwrite the "greeter" shown by alpha-nvim which seems to be well liked.

Does vim.defer(_fn) fix that?

Iron-E avatar Oct 27 '23 20:10 Iron-E

I think some combination of the newest versions of nvim, barbar, and alpha-nvim play nicely. I'm now seeing that if I run nvim as a command with no arguments, the alpha-nvim splash screen appears, but when I run with a file argument it opens directly in a barbar tab, and with a directory argument it opens with the file tree sidebar -- desired/expected behavior.

I don't know if that addresses the original issue as written, but certainly makes my comment obsolete.

Sorry this took me so long to reply. I'm still quite the nvim/lua novice, so my investigation was slow.

AidanJHMurphy avatar Mar 06 '24 19:03 AidanJHMurphy

With that information and the discussion above, I think we can close this issue. If someone wants to submit a fix that makes the startup screen appear, feel free to send a PR.

romgrk avatar Mar 06 '24 19:03 romgrk