Skip to content

Commit

Permalink
fix(state): dont return or autocmd will cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jul 12, 2024
1 parent 0442a73 commit 9a77986
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lua/which-key/state.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ function M.setup()
group = group,
callback = function(ev)
if not Util.safe() then
return M.stop()
end
M.stop()
-- make sure the buffer mode exists
if Buf.get() and Util.xo() then
return not M.state and M.start()
elseif Buf.get() and Util.xo() then
if not M.state then
M.start()
end
elseif not ev.match:find("c") then
M.stop()
end
Expand Down

0 comments on commit 9a77986

Please sign in to comment.