romgrk / barbar.nvim

The neovim tabline plugin.
2.16k stars 81 forks source link

Raises E315: ml_get error when I delete a buffer. #593

Closed EdmundsEcho closed 6 days ago

EdmundsEcho commented 1 week ago

Description

When I delete a buffer when many are open, I get a series of E315: ml_get: Invalid lnum: 1. When I disable barbar I can delete buffers without error. While the plugin tries to recover, the ability to view some of the buffers fails. The fix is to quit and restart neovim (I'm doing that about once every 5 min).

Finally, I provided the level 10 logs where it's clear that barbar is triggering the errors when I delete a buffer and then tries to recover.

To Reproduce Open several buffers. Navigate here and there. Delete a buffer - bang.

I use lazy for my plugin manager. Here is my config that only touches on icons.

return {
    "romgrk/barbar.nvim",
    enabled = true,
    dependencies = {
        "lewis6991/gitsigns.nvim", -- OPTIONAL: for git status
        "nvim-tree/nvim-web-devicons", -- OPTIONAL: for file icons
    },
    version = "^1.0.0", -- optional: only update when a new 1.x version is released
    init = function() vim.g.barbar_auto_setup = false end,
    opts = {
        icons = {
            -- Configure the base icons on the bufferline.
            -- Valid options to display the buffer index and -number are `true`, 'superscript' and 'subscript'
            buffer_index = false,
            buffer_number = false,
            button = "×",

            separator = { left = "|", right = "" },
            inactive = { button = "×" },

            -- Configure the icons on the bufferline based on the visibility of a buffer.
            -- Supports all the base icon options, plus `modified` and `pinned`.
            alternate = { filetype = { enabled = false } },
            current = { buffer_index = true },
            visible = { modified = { buffer_number = false } },
            diagnostics = {
                [vim.diagnostic.severity.ERROR] = {
                    enabled = true,
                    icon = "ff",
                },
                [vim.diagnostic.severity.WARN] = { enabled = false },
                [vim.diagnostic.severity.INFO] = { enabled = false },
                [vim.diagnostic.severity.HINT] = { enabled = true },
            },
        },
    },
}

Informations Neovim version: 0.10 The plugin is up-to-date using lazy.

Vim log when I delete a buffer

neovim log level 10 ``` Executing BufDelete Autocommands for "*" autocommand Executing BufDelete Autocommands for "*" autocommand Executing BufDelete Autocommands for "*" autocommand Executing BufDelete Autocommands for "*" autocommand Executing BufDelete Autocommands for "" autocommand Executing DiagnosticChanged Autocommands for "*" autocommand Error detected while processing DiagnosticChanged Autocommands for "*": E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 E315: ml_get: Invalid lnum: 1 Barbar detected an error while running. Barbar disabled itself :/ Include this in your report: Keyboard interrupt stack traceback: ^I[C]: in function 'fnamemodify' ^I.../.local/share/nvim/lazy/barbar.nvim/lua/barbar/icons.lua:60: in function 'get_icon' ^I...cal/share/nvim/lazy/barbar.nvim/lua/barbar/ui/layout.lua:139: in function 'calculate_buffer_width' ^I...cal/share/nvim/lazy/barbar.nvim/lua/barbar/ui/layout.lua:203: in function 'calculate_buffers_width' ^I...cal/share/nvim/lazy/barbar.nvim/lua/barbar/ui/layout.lua:65: in function 'calculate' ^I...cal/share/nvim/lazy/barbar.nvim/lua/barbar/ui/render.lua:403: in function 'generate_tabline' ^I...cal/share/nvim/lazy/barbar.nvim/lua/barbar/ui/render.lua:563: in function <...cal/share/nvim/lazy/barbar.nvim/lua/barbar/ui/render.lua:563> ^I[C]: in function 'xpcall' ^I...cal/share/nvim/lazy/barbar.nvim/lua/barbar/ui/render.lua:562: in function 'update' ^I....local/share/nvim/lazy/barbar.nvim/lua/barbar/events.lua:226: in function <....local/share/nvim/lazy/barbar.nvim/lua/barbar/events.lua:224> ^I[C]: in function 'nvim_exec_autocmds' ^I.../neovim/0.10.0/share/nvim/runtime/lua/vim/diagnostic.lua:1925: in function 'reset' ^I...vim/0.10.0/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:389: in function 'clear' ^I...vim/0.10.0/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:406: in function 'disable' ^I...vim/0.10.0/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:454: in function <...vim/0.10.0/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:453> Executing BufEnter Autocommands for "*" autocommand lua require'lualine.components.branch.git_branch'.find_git_dir() ```
Iron-E commented 1 week ago

Related: https://github.com/romgrk/barbar.nvim/issues/588, #583

If the version constraint is removed, does it start working? I wonder if our release isn't getting picked up for updates or if the issue really has cropped up again.

EdmundsEcho commented 6 days ago

I have removed the version 1.0 constraint. The updated version fixes the issue. Thank you.

Iron-E commented 5 days ago

lazy.nvim recently had a major version release, and today there may have been a bug fix related to the tag feature on their side