[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hyperdrive dc2488436d 17/30: Change: (hyperdrive-dir-colum
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/hyperdrive dc2488436d 17/30: Change: (hyperdrive-dir-column-headers) Fix column headers highlight |
Date: |
Wed, 6 Sep 2023 18:59:43 -0400 (EDT) |
branch: elpa/hyperdrive
commit dc2488436db1bf93cd82579664b432b036f08720
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>
Change: (hyperdrive-dir-column-headers) Fix column headers highlight
---
hyperdrive-dir.el | 49 +++++++++++++++++++++++++++++++------------------
1 file changed, 31 insertions(+), 18 deletions(-)
diff --git a/hyperdrive-dir.el b/hyperdrive-dir.el
index 013ac73245..4a17bfe290 100644
--- a/hyperdrive-dir.el
+++ b/hyperdrive-dir.el
@@ -127,24 +127,37 @@ Columns are suffixed with up/down arrows according to
'face 'hyperdrive-header-arrow))
(headers))
(pcase-dolist (`(,column . ,(map (:desc desc))) hyperdrive-dir-sort-fields)
- (let ((selected (eq column sort-column))
- ;; Put the arrow after desc, since the column is left-aligned.
- (arrow-after (eq column 'name)))
- (push (propertize
- (concat (and selected (not arrow-after) arrow)
- (propertize desc 'face 'hyperdrive-column-header)
- (and selected arrow-after arrow))
- 'keymap
- (define-keymap
- "<mouse-1>" (lambda (&optional _e)
- (interactive "e")
- (hyperdrive-dir-sort
- (hyperdrive-dir-toggle-sort-direction column
hyperdrive-directory-sort))))
- 'mouse-face 'highlight)
- headers)))
- (concat prefix "\n"
- (apply #'format (format "%%6s %%%ds %%s"
hyperdrive-timestamp-width)
- (nreverse headers)))))
+ (let* ((selected (eq column sort-column))
+ ;; Put the arrow after desc, since the column is left-aligned.
+ (left-aligned (eq column 'name))
+ (format-str (pcase column
+ ('size "%6s")
+ ('mtime (format "%%%ds" hyperdrive-timestamp-width))
+ ('name (format "%%-%ds" (- (window-width) 6 2
hyperdrive-timestamp-width 2)))))
+ (desc (concat (and selected (not left-aligned) arrow)
+ (and (not left-aligned) " ")
+ (propertize desc 'face 'hyperdrive-column-header)
+ ;; This extra space is necessary to prevent
+ ;; the `hyperdrive-column-header' face from
+ ;; extended to the end of the window.
+ (and left-aligned " ")
+ (and selected left-aligned arrow))))
+ (push (propertize (format format-str desc)
+ 'keymap
+ (define-keymap
+ "<mouse-1>" (lambda (&optional _e)
+ (interactive "e")
+ (hyperdrive-dir-sort
+
(hyperdrive-dir-toggle-sort-direction
+ column
hyperdrive-directory-sort))))
+ 'mouse-face 'highlight)
+ headers)
+ (unless (eq column 'name)
+ ;; These gap spaces are necessary to prevent display mouse-face
+ ;; from activating all contiguous strings simultaneously.
+ (push " " headers))))
+ (apply #'concat prefix "\n" (nreverse headers))))
+
(defun hyperdrive-dir-complete-sort ()
"Return a value for `hyperdrive-directory-sort' selected with completion."
- [nongnu] elpa/hyperdrive dbbe0ecd43 05/30: Add: (hyperdrive-time-greater-p) Inverse of time-less-p, (continued)
- [nongnu] elpa/hyperdrive dbbe0ecd43 05/30: Add: (hyperdrive-time-greater-p) Inverse of time-less-p, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 6d41b67aab 04/30: Comment: Add TODO, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 838b34927c 03/30: Change: (hyperdrive-sort-entries) Rename BY argument to DIRECTION, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 5f1d617ae1 11/30: Change: (hyperdrive-dir-sort-fields) Add description, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 09e4dba5b2 14/30: Tidy: (hyperdrive-dir-column-headers) let-bind selected/arrow-after, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 57d02e33f4 15/30: Change: (hyperdrive-dir-column-headers) Add mouse-face, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 303109d76e 19/30: Fix: Typo, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 8d47207e21 21/30: Docs: Document clickable directory column headers, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive dc54ccbfbf 12/30: Tidy: (hyperdrive-dir-column-headers) Reduce duplication, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 80d68a0378 16/30: Change: Replace -timestamp-width with -timestamp-format-string, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive dc2488436d 17/30: Change: (hyperdrive-dir-column-headers) Fix column headers highlight,
ELPA Syncer <=
- [nongnu] elpa/hyperdrive a39567f697 24/30: Change: (hyperdrive--fill) Use string-match-p, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 447994e8b2 13/30: Change: (hyperdrive-dir-column-headers) Clickable column headers, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive db30be6a57 28/30: Comment: Update TODO, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive bbd78c6361 23/30: Docs: Update customization option docs, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 53927eb0a9 25/30: Merge branch 'check-writablep', ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive fcda78fd06 30/30: Merge branch 'dir-sort-clickable', ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 68ee5c5213 22/30: Meta: Update changelog, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive decf302b97 27/30: Fix: Require url, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive eaf2e5104f 29/30: Comment: Remove TODOs, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 328635c1f9 07/30: Change: (hyperdrive-directory-sort) Use column name as alist key, ELPA Syncer, 2023/09/06