Skip to content

Commit

Permalink
Eval the map expression
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchengxu committed Jul 24, 2019
1 parent ccb656f commit 80a1e88
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions autoload/which_key/map.vim
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ function! which_key#map#parse(key, dict, visual) " {{{

let mapd.rhs = substitute(mapd.rhs, "<SID>", "<SNR>".mapd['sid']."_", "g")

" eval the expression as the final {rhs}
" Ref #60
if mapd.expr
let mapd.rhs = eval(mapd.rhs)
endif

if mapd.lhs != '' && mapd.display !~# 'WhichKey.*'
if (visual && match(mapd.mode, "[vx ]") >= 0) ||
\ (!visual && match(mapd.mode, "[vx]") == -1)
Expand Down

0 comments on commit 80a1e88

Please sign in to comment.