[X] I have searched the existing issues of which-key.nvim
[X] I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
NVIM v0.10.0-dev-1088+g6b5f44817
Operating system/version
MacOS 13.4.1
Describe the bug
which-key spell suggest always shows suggestions for the first misspelled word in the word, even if your cursor is on the last word
native spell suggest will instead show no suggestions for "MySpellledWordd" when hovered over "My", "Spelled" when hovered over "Spellled", and "Word" when hovered over "Wordd". which-key will always show suggestions for "Spellled"
This behavior difference is actually fine IMO.
(the problem) when you accept the spell suggest, it replaces the entire word e.g. "MySpellledWordd" -> "Spelled". Native spell-suggest behaves correctly.
Steps To Reproduce
nvim -u spell.lua
Type in "MySpellledWordd" and use z= on each word.
Expected Behavior
Should match native spell suggest.
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", lazy = false },
{ "folke/which-key.nvim", event = "VeryLazy", config = true },
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
-- vim.cmd.colorscheme("tokyonight")
-- add anything else here
vim.opt.spelllang = 'en_us'
vim.opt.spell = true
vim.opt.spelloptions:append({ "camel" })
Did you check docs and existing issues?
Neovim version (nvim -v)
NVIM v0.10.0-dev-1088+g6b5f44817
Operating system/version
MacOS 13.4.1
Describe the bug
which-key
spell suggest always shows suggestions for the first misspelled word in the word, even if your cursor is on the last wordwhich-key
will always show suggestions for "Spellled"Steps To Reproduce
nvim -u spell.lua
z=
on each word.Expected Behavior
Should match native spell suggest.
Repro