Use `window-width' to wrap menu items.
This commit is contained in:
parent
2e00a113d9
commit
564726a247
1 changed files with 2 additions and 3 deletions
|
@ -379,13 +379,12 @@ put it in magit-key-mode-key-maps for fast lookup."
|
||||||
|
|
||||||
(defun magit-key-mode-draw-in-cols (strings)
|
(defun magit-key-mode-draw-in-cols (strings)
|
||||||
"Given a list of strings, print in columns (using `insert')."
|
"Given a list of strings, print in columns (using `insert')."
|
||||||
(let ((longest-act (apply 'max (mapcar 'length strings)))
|
(let ((longest-act (apply 'max (mapcar 'length strings))))
|
||||||
(max-size 70))
|
|
||||||
(while strings
|
(while strings
|
||||||
(let ((str (car strings)))
|
(let ((str (car strings)))
|
||||||
(let ((padding (make-string (- (+ longest-act 3) (length str)) ? )))
|
(let ((padding (make-string (- (+ longest-act 3) (length str)) ? )))
|
||||||
(insert str)
|
(insert str)
|
||||||
(if (and (> (+ (current-column) longest-act) max-size)
|
(if (and (> (+ (current-column) longest-act) (window-width))
|
||||||
(cdr strings))
|
(cdr strings))
|
||||||
(insert "\n")
|
(insert "\n")
|
||||||
(insert padding))))
|
(insert padding))))
|
||||||
|
|
Loading…
Reference in a new issue