mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-03-01 03:11:09 -08:00
Add hint for next page key
Only shows when using echo for which-key-show-prefix See #53
This commit is contained in:
parent
cf6ffc985b
commit
ad0fcac8a3
1 changed files with 16 additions and 3 deletions
19
which-key.el
19
which-key.el
|
|
@ -961,14 +961,24 @@ enough space based on your settings and frame size." prefix-keys)
|
|||
(prefix-w-face (which-key--propertize-key prefix-keys))
|
||||
(dash-w-face (propertize "-" 'face 'which-key-key-face))
|
||||
(status-left (propertize (format "%s/%s" (1+ page-n) n-pages)
|
||||
'face 'font-lock-comment-face))
|
||||
'face 'which-key-separator-face))
|
||||
(status-top (when (< 1 n-pages)
|
||||
(propertize (format "(%s of %s)" (1+ page-n) n-pages)
|
||||
'face 'font-lock-comment-face)))
|
||||
'face 'which-key-separator-face)))
|
||||
(first-col-width (+ 2 (max (string-width prefix-w-face)
|
||||
(string-width status-left))))
|
||||
(prefix-left (s-pad-right first-col-width " " prefix-w-face))
|
||||
(status-left (s-pad-right first-col-width " " status-left))
|
||||
(nxt-pg-hint (when (and (< 1 n-pages)
|
||||
(eq 'which-key-show-next-page
|
||||
(key-binding
|
||||
(kbd (concat prefix-keys
|
||||
" "
|
||||
which-key-paging-key)))))
|
||||
(propertize (concat "press "
|
||||
which-key-paging-key
|
||||
" for next page")
|
||||
'face 'which-key-separator-face)))
|
||||
new-end lines first)
|
||||
(cond ((and (< 1 n-pages)
|
||||
(eq which-key-show-prefix 'left))
|
||||
|
|
@ -986,7 +996,10 @@ enough space based on your settings and frame size." prefix-keys)
|
|||
((eq which-key-show-prefix 'top)
|
||||
(setq page (concat prefix-w-face dash-w-face " " status-top "\n" page)))
|
||||
((eq which-key-show-prefix 'echo)
|
||||
(which-key--echo (concat prefix-w-face dash-w-face " " status-top))))
|
||||
(which-key--echo (concat prefix-w-face
|
||||
dash-w-face " "
|
||||
status-top
|
||||
" " nxt-pg-hint))))
|
||||
(which-key--lighter-status n-shown n-tot)
|
||||
(if (eq which-key-popup-type 'minibuffer)
|
||||
(which-key--echo page)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue