[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/free-keys d681a3fba0 12/19: Fix the "overflow" bug on the
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/free-keys d681a3fba0 12/19: Fix the "overflow" bug on the last/first row if the displayed list was not rectangular |
Date: |
Sat, 29 Jan 2022 08:02:53 -0500 (EST) |
branch: elpa/free-keys
commit d681a3fba0856dd78cf5d9f959692c72b44eb2b5
Author: Matus Goljer <dota.keys@gmail.com>
Commit: Matus Goljer <dota.keys@gmail.com>
Fix the "overflow" bug on the last/first row if the displayed list was not
rectangular
---
free-keys.el | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/free-keys.el b/free-keys.el
index 7543bb2988..e3f142a7cb 100644
--- a/free-keys.el
+++ b/free-keys.el
@@ -67,12 +67,17 @@ The columns are ordered according to variable
`free-keys-keys',
advancing down-right. The margin between each column is 5 characters."
(setq columns (or columns 80))
(let* ((len (+ 5 (length (car key-list))))
+ (num-of-keys (length key-list))
(cols (/ columns len))
- (rows (/ (length key-list) cols))
+ (rows (1+ (/ num-of-keys cols)))
+ (rem (mod num-of-keys cols))
(cur-col 0)
(cur-row 0))
- (dotimes (i (length key-list))
- (insert (nth (+ (* cur-col rows) cur-row) key-list) " ")
+ (dotimes (i num-of-keys)
+ (insert (nth
+ (+ (* cur-col rows) cur-row (if (> cur-col rem) (- rem cur-col)
0))
+ key-list)
+ " ")
(cl-incf cur-col)
(when (= cur-col cols)
(insert "\n")
- [nongnu] branch elpa/free-keys created (now 7348ce6819), ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys d681a3fba0 12/19: Fix the "overflow" bug on the last/first row if the displayed list was not rectangular,
ELPA Syncer <=
- [nongnu] elpa/free-keys 3b4a18417b 06/19: Add revert function, ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys a975b8fe62 15/19: Suppress byte-compile warning, ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys 11241fd518 07/19: Display keys for which keybinding is 'undefined., ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys f5db0a1e43 02/19: Add the note about `bind-key`, fix typos, ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys f5d882d4c7 11/19: Better display of empty keys (no empty groups, fixed nil modifiers), ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys 8c9ea744c1 08/19: Move header help into header-line-format, ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys 79205af5f5 01/19: Initial commit, ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys 452d26a3fc 03/19: Do not autoload the major-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys aca6032c3e 05/19: Merge pull request #1 from syohex/support-for-old-emacs, ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys 9cc42a07a6 04/19: Support old emacs(<= 24.2), ELPA Syncer, 2022/01/29