Skip to content

Commit

Permalink
Sort prefix keys to the end (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
pinealan authored Oct 2, 2020
1 parent 641df56 commit 30c0810
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion autoload/which_key/renderer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,18 @@ function! s:create_rows(layout, mappings) abort
let rows = []
let row = 0
let col = 0
let smap = sort(filter(keys(mappings), 'v:val !=# "name"'), 'i')

let leaf_keys = []
let dict_keys = []
for key in sort(filter(keys(mappings), 'v:val !=# "name"'), 'i')
if type(mappings[key]) == s:TYPE.dict
call add(dict_keys, key)
else
call add(leaf_keys, key)
endif
endfor

let smap = leaf_keys + dict_keys
let displaynames = which_key#renderer#get_displaynames()
if get(g:, 'which_key_align_by_seperator', 1)
Expand Down

0 comments on commit 30c0810

Please sign in to comment.