Skip to content

bug: max_filename_width does not hide filename #36

@TM10YMhp

Description

@TM10YMhp

Neovim version (nvim -v)

NVIM v0.10.3

Operating system/version

Windows 10

Describe the bug

I tried to hide the filename in the table of contents (gO), but when max_filename_width returns 0, there are still characters left in the list.

quicker_1033.mp4

What is the severity of this bug?

minor (annoyance)

Steps To Reproduce

  1. nvim -u repro.lua
  2. open help: :help
  3. open table of contents: gO
  4. close table of contents: :q
  5. open help: :help
  6. open table of contents: gO

Expected Behavior

Hide the filename when max_filename_width returns 0.

Minimal example file

No response

Minimal init.lua

-- DO NOT change the paths and don't remove the colorscheme
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

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  {
    "stevearc/quicker.nvim",
    config = function()
      require("quicker").setup({
        -- add your config here
        max_filename_width = function()
          if
            vim.w.qf_toc
            or (vim.w.quickfix_title and vim.w.quickfix_title:find("TOC"))
          then
            return 0
          end
          return math.floor(math.min(95, vim.o.columns / 2))
        end,
      })
    end,
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions