echasnovski / mini.nvim

Library of 40+ independent Lua modules improving overall Neovim (version 0.8 and higher) experience with minimal effort
MIT License
4.54k stars 175 forks source link

mini.starter: `buf_id` in `refresh()` is not an identifier of valid Starter buffer. #884

Closed nexxai closed 2 months ago

nexxai commented 2 months ago

Contributing guidelines

Module(s)

mini.starter

Description

I use LazyVim and I haven't made any changes to it recently (beyond just the usual updating packages to their latest versions) but this error just started popping up as soon as I open NeoVim. I can make it go away by hitting q but I was wondering if there's a way to figure out why it started coming up out of nowhere.

Neovim version

happened in 0.9.5; still happening in 0.10.0

Steps to reproduce

  1. nvim -nu minimal.lua
  2. ...

Expected behavior

The notice not to come up

Actual behavior

Screenshot 2024-05-16 at 12 57 44 PM
echasnovski commented 2 months ago

Thanks for the issue!

Unfortunately, without more information I can not reproduce. It looks like there is some other file explorer plugin loaded, so it would be better to have at least somewhat minimal reproduction steps here.

aboettger commented 2 months ago

Same problem here. How can I provide you with more information?

echasnovski commented 2 months ago

Same problem here. How can I provide you with more information?

Ideally - a minimal 'init.lua' that I can use with NVIM_APPIMAGE to reproduce. At bare minimum - which relevant parts of LazyVim are used at startup. It seems like there should be at least some file explorer and 'mini.starter'.

pejax commented 2 months ago

Same problem here. Steps to reproduce on macOS 14.5:

  1. Checkout/clone LazyVim starter https://github.com/LazyVim/starter to ~/.config/testnvim
  2. Export NVIM_APPNAME=testnvim
  3. Remove testvim/lua/plugins/example.lua
  4. Add testvim/lua/plugins/core.lua (code from below)
  5. Open nvim with new file ('nvim somefile.txt')
  6. Check the error message

Thank you for checking.

-- Core Plugins

-- "echasnovski/mini.starter (Mini Starter)

return {
  -- Use mini.starter instead of alpha
  { import = "lazyvim.plugins.extras.ui.mini-starter" },
  {
    "echasnovski/mini.starter",
    version = "*",
    event = "VimEnter",
    opts = function()
      local logo = table.concat({
        "██╗      █████╗ ███████╗██╗   ██╗██╗   ██╗██╗███╗   ███╗          Z",
        "██║     ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║   ██║██║████╗ ████║      Z",
        "██║     ███████║  ███╔╝  ╚████╔╝ ██║   ██║██║██╔████╔██║   z",
        "██║     ██╔══██║ ███╔╝    ╚██╔╝  ╚██╗ ██╔╝██║██║╚██╔╝██║ z",
        "███████╗██║  ██║███████╗   ██║    ╚████╔╝ ██║██║ ╚═╝ ██║",
        "╚══════╝╚═╝  ╚═╝╚══════╝   ╚═╝     ╚═══╝  ╚═╝╚═╝     ╚═╝",
      }, "\n")
      local pad = string.rep(" ", 22)
      local new_section = function(name, action, section)
        return { name = name, action = action, section = pad .. section }
      end

      local starter = require("mini.starter")
      --stylua: ignore
      local config = {
        evaluate_single = true,
        header = logo,
        items = {
          new_section("aliases",      "e $HOME/.aliases",               "Dotfiles"),
          new_section("dialog",       "e $HOME/.dialog",                "Dotfiles"),
          new_section("environment",  "e $HOME/.environment",           "Dotfiles"),
          new_section("functions",    "e $HOME/.functions",             "Dotfiles"),
          new_section("motd",         "e $HOME/.motd",                  "Dotfiles"),
          new_section("projects",     "e $HOME/.projects",              "Dotfiles"),
          new_section("shellrc",      "e $HOME/.shellrc",               "Dotfiles"),
          new_section("tmux",         "e $HOME/.config/tmux/tmux.conf", "Dotfiles"),
          new_section("vimrc",        "e $HOME/.vimrc",                 "Dotfiles"),
          new_section("zshrc",        "e $HOME/.zshrc",                 "Dotfiles"),
          new_section("recent files", "Telescope oldfiles",             "Telescope"),
          new_section("grep text",    "Telescope live_grep",            "Telescope"),
          new_section("lazy",         "Lazy",                           "Config"),
          new_section("init.lua",     "e $MYVIMRC",                     "Config"),
          new_section("new file",     "ene | startinsert",              "Built-in"),
          new_section("quit",         "qa",                             "Built-in"),
        },
        content_hooks = {
          starter.gen_hook.adding_bullet(pad .. "░ ", false),
          starter.gen_hook.aligning("center", "center"),
        },
      }
      return config
    end,
  },
}
echasnovski commented 2 months ago

Same problem here. Steps to reproduce on macOS 14.5:

Thanks, I can reproduce this. As I can not reproduce this with my own config and nvim somefile.txt, this looks like a conflict with some other plugin. I'll take a look.

echasnovski commented 2 months ago

This is the issue with LazyVim, not 'mini.starter'. The message goes away if { import = "lazyvim.plugins.extras.ui.mini-starter" }, line is removed. There is this call in 'lazyvim.plugins.extras.ui.mini-starter' which does not guard against the appeared message because it is not an error.

I think the suggested solution is to remove { import = "lazyvim.plugins.extras.ui.mini-starter" }, from the config as you mostly have 'mini.starter' setup in your config.

Closing as not an issue with 'mini.starter'.