Skip to content

Commit

Permalink
fix: don't show spelling when the command was started with a count #80
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed May 20, 2021
1 parent 2be929e commit 20a85bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/which-key/plugins/spelling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ end
---@type Plugin
---@return PluginItem[]
function M.run(_trigger, _mode, _buf)
-- if started with a count, let the default keybinding work
local count = vim.api.nvim_get_vvar("count")
if count and count > 0 then return {} end

local cursor_word = vim.fn.expand("<cword>")
-- get a misspellled word from under the cursor, if not found, then use the cursor_word instead
local bad = vim.fn.spellbadword(cursor_word)
Expand Down

0 comments on commit 20a85bd

Please sign in to comment.