luukvbaal / statuscol.nvim

Status column plugin that provides a configurable 'statuscolumn' and click handlers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[0.10 branch] SIGABRT statusline.c:260: stl_fill_click_defs: Assertion `len <= width' failed

serranomorante opened this issue · comments

Hi! I'm getting this error with statuscol on neovim 0.10 (main)
/home/runner/work/neovim/neovim/src/nvim/statusline.c:260: stl_fill_click_defs: Assertion len <= width' failed`

This issue seems to have been introduced by this commit from yesterday but I'm not 100% sure.

Steps to replicate

Just copy the following snippet into a file, let's say repro.lua. Then open vim with this command: nvim --clean +'so repro.lua'

It will first install the necessary dependencies.
Close vim and open it again with nvim --clean +'so repro.lua' to see the error.
You don't need to do anything else.

-- DO NOT change the paths
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

--------------------------------------------------------------------------------

vim.opt.signcolumn = "yes:1"

--------------------------------------------------------------------------------

local plugins = {
  {
    -- Remove ugly numbers in the foldcolumn
    -- Thanks: https://github.com/kevinhwang91/nvim-ufo/issues/4#issuecomment-1512772530
    "luukvbaal/statuscol.nvim",
    lazy = false,
    branch = "0.10", -- https://github.com/luukvbaal/statuscol.nvim/commit/ec939ac7d5e8560d0305b6d54f41bc8a3f7be0c7
    config = function()
      local builtin = require("statuscol.builtin")
      require("statuscol").setup({
        relculright = true,
        segments = {
          { text = { "%s" }, click = "v:lua.ScSa" },
          { text = { builtin.lnumfunc }, click = "v:lua.ScLa" },
          {
            text = { " ", builtin.foldfunc, " " },
            condition = { builtin.not_empty, true, builtin.not_empty },
            click = "v:lua.ScFa",
          },
        },
      })
    end,
  },
}

--------------------------------------------------------------------------------

local lazypath = root .. "/plugins/lazy.nvim"
---@diagnostic disable-next-line: undefined-field
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

This issue seems to have been introduced by this commit from yesterday but I'm not 100% sure.

Hey. That commit should have fixed the issue, are you sure you are on a build that includes that commit (nightly builds don't yet, it was merged a few hours ago)?

This issue seems to have been introduced by this commit from yesterday but I'm not 100% sure.

Hey. That commit should have fixed the issue, are you sure you are on a build that includes that commit (nightly builds don't yet, it was merged a few hours ago)?

That is correct. I though the neovim-nightly-bin from AUR was the same as main. I now built neovim manually and the issue is resolved! Thanks!