Skip to content

Commit

Permalink
fix: convert trings with strtrans to properly render non printable ch…
Browse files Browse the repository at this point in the history
…aracters
  • Loading branch information
folke committed May 15, 2021
1 parent 386591e commit d85ce36
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/which-key/keys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ function M.get_mappings(mode, prefix, buf)
local tmp = {}
for _, value in pairs(ret.mappings) do
value.key = value.keys.nvim[prefix_len + 1]
value.key = vim.fn.strtrans(value.key)
local skip = not value.label and Config.options.ignore_missing == true
if Util.t(value.key) == Util.t("<esc>") then
skip = true
Expand All @@ -122,6 +123,9 @@ function M.get_mappings(mode, prefix, buf)
value.label = value.label:gsub(v, "")
end
end
if value.value then
value.value = vim.fn.strtrans(value.value)
end
table.insert(tmp, value)
end
end
Expand Down

0 comments on commit d85ce36

Please sign in to comment.