noice.nvim
noice.nvim copied to clipboard
bug: ":hep", ":hl" and ":hp" get recognized as help command
Did you check docs and existing issues?
- [X] I have read all the noice.nvim docs
- [X] I have searched the existing issues of noice.nvim
- [X] I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
0.9.5
Operating system/version
NixOS 23.11
Describe the bug
Pattern that is used for help command detection (^:%s*he?l?p?%s+
) as both false positives (hp
, hl
, hep
) and false negatives (vert he
and so on)
Steps To Reproduce
- open nvim with installed noice.nvim and default opts
- type
:hl
(with a space) - observe the command getting recognized as help
Expected Behavior
:hl
doesn't get recognized as a help command
nice to have: :vert he
and so on getting recognized instead (maybe make patterns take string|bool(string)
values?)
Repro
-- 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", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
{ "folke/noice.nvim", dependencies = { "MunifTanjim/nui.nvim" }, opts = {} },
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
obv a minor one but it's triggering me
Don't know if you've already found this way but by passing a new pattern for the help command, we can modify this behaviour:
require("noice").setup({
cmdline = {
format = {
help = { pattern = { "^:%s*help?%s+", "^:%s*hel?%s+", "^:%s*he?%s+" }},
},
},
})
I just modified the regex that was provided in README and atleast in my testing it works correctly.
@folke It would be nice I think to include this or a variation of this in the code so that only h
, he
, hel
and help
gets detected as help.
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.
This issue was closed because it has been stalled for 7 days with no activity.