Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: max_filename_width does not hide filename #36

Closed
TM10YMhp opened this issue Dec 31, 2024 · 1 comment
Closed

bug: max_filename_width does not hide filename #36

TM10YMhp opened this issue Dec 31, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@TM10YMhp
Copy link

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

@TM10YMhp TM10YMhp added the bug Something isn't working label Dec 31, 2024
@stevearc
Copy link
Owner

stevearc commented Jan 3, 2025

Should be fixed now

@stevearc stevearc closed this as completed Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants