I have a super ultrawide monitor (aspect ratio 32:9), which is VERY wide. When displaying which-key in a posframe across the entire width of the monitor it gets pretty uncomfortable to read it. It would be nicet to add a customizable variable where the user could set a max width for the posframe.
Maybe something like this:
(defvar which-key-posframe-max-width nil
"The maximum width of the posframe. If nil, fill the frame width.")
(defun which-key-posframe--max-dimensions (_)
"Return max-dimensions of posframe.
The returned value has the form (HEIGHT . WIDTH) in lines and
characters respectably."
(cons (- (frame-height) 2) ; account for mode-line and minibuffer
(if which-key-posframe-max-width
(min which-key-posframe-max-width (frame-width))
(frame-width))))
I have a super ultrawide monitor (aspect ratio 32:9), which is VERY wide. When displaying which-key in a posframe across the entire width of the monitor it gets pretty uncomfortable to read it. It would be nicet to add a customizable variable where the user could set a max width for the posframe.
Maybe something like this: