Skip to content

Commit

Permalink
fix: reset op_count when it's 0
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed May 12, 2021
1 parent 36616ca commit e3ad7c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/which-key/keys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ function M.process_motions(ret, mode, prefix, buf)
if (mode == "n" or mode == "v") and operator then
local op_prefix = prefix:sub(#operator + 1)
local op_count = op_prefix:match("^(%d+)")
if op_count and op_count ~= "0" then
if op_count == "0" then op_count = nil end
if op_count then
op_prefix = op_prefix:sub(#op_count + 1)
end
local op_results = M.get_mappings("o", op_prefix, buf)
Expand Down

0 comments on commit e3ad7c9

Please sign in to comment.