Skip to content

Commit

Permalink
fix: add remaining <esc> to pending in case there's no other characters
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jul 5, 2021
1 parent bb829a1 commit 29a82b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/which-key/view.lua
Expand Up @@ -62,7 +62,7 @@ function M.read_pending()
while true do
local n = vim.fn.getchar(0)
if n == 0 then
return
break
end
local c = (type(n) == "number" and vim.fn.nr2char(n) or n)

Expand All @@ -88,6 +88,10 @@ function M.read_pending()
M.keys = M.keys .. c
end
end
if esc ~= "" then
M.keys = M.keys .. esc
esc = ""
end
end

function M.getchar()
Expand Down

0 comments on commit 29a82b5

Please sign in to comment.