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: cmdline format title isn't included for new formats #973

Open
4 tasks done
pier-oliviert opened this issue Oct 24, 2024 · 1 comment
Open
4 tasks done

bug: cmdline format title isn't included for new formats #973

pier-oliviert opened this issue Oct 24, 2024 · 1 comment
Labels
bug Something isn't working stale

Comments

@pier-oliviert
Copy link

pier-oliviert commented Oct 24, 2024

Did you check docs and existing issues?

  • I have read all the noice.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of noice.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.2 Build type: Release LuaJIT 2.1.1727870382

Operating system/version

MacOS 14.6.1

Describe the bug

I am trying to extend the cmdline.format table to include another option. The option is working as expected, but there is one thing that's been bugging me:

The title is not shown. All other options (cmdline, help, search, etc.) have the title display in the prompt except mine.

I am not very good at Lua, so I might be wrong, but it seems like this line https://github.com/folke/noice.nvim/blob/main/lua/noice/ui/cmdline.lua#L117

Should instead defaults to the format's title. Since I believe an undefined field is nil the change is backward compatible? I could be wrong, as I said, I'm really not good at Lua :)

message.title = format.title

Steps To Reproduce

  1. Open cmdline (:)
  2. Type in the cmdline [R, space]: R
  3. The icon should change, but the title cmdline should disappear

Expected Behavior

The title should change to Testerino (in the repro case).

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    { "folke/noice.nvim", opts = {} },
    -- add any other plugins here
  },
})

require("noice").setup({
  lsp = {
    override = {
      ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
      ["vim.lsp.util.stylize_markdown"] = true,
      ["cmp.entry.get_documentation"] = true,
    },
  },
  cmdline = {
    format = {
      redir = { pattern = { "^:%s*R%s+", "^:Redir %s*" }, icon = "", title = "Testerino" },
    },
  },
})
@pier-oliviert pier-oliviert added the bug Something isn't working label Oct 24, 2024
@pier-oliviert pier-oliviert changed the title bug: format title isn't included bug: cmdline format title isn't included for new formats Oct 24, 2024
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

1 participant