-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
2024-12-06.12-46-02.mp4
When typing --foo=bar there's a chance that the whole string is included as part of the completion and it causes unexpected results. --foo=bar becomes --foo=bar--foo=bar.
As you continue typing, the entries are not cleared and it merges with the previous, causing hundreds of completions. (This is likely a separate issue related to should_merge_previous_items)
See the recording to show both issues at once
reproduction.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", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
{
"neovim/nvim-lspconfig",
},
{
"hrsh7th/nvim-cmp",
config = function()
local cmp = require("cmp")
cmp.setup(
{
mapping = {
-- Moving through completions
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
['<C-y>'] = cmp.mapping.confirm { select = true },
},
}
)
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources(
{
{ name = "path" },
},
{
{
name = "cmdline",
option = {
ignore_cmds = { "Man", "!" }
}
}
}
)
})
end,
dependencies = {
"hrsh7th/cmp-cmdline",
}
},
{
"ColinKennedy/nvim-best-practices-plugin-template",
version = "v1.*",
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})Type :PluginTemplate hello-world say phrase --repeat= followed by some numbers
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels