[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hyperdrive 17c8913d18 3/4: Fix: (h/ewoc-next) Handle empty
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/hyperdrive 17c8913d18 3/4: Fix: (h/ewoc-next) Handle empty directories |
Date: |
Fri, 6 Dec 2024 16:00:04 -0500 (EST) |
branch: elpa/hyperdrive
commit 17c8913d1813e51a97abe3a98158a1da92d94f5b
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>
Fix: (h/ewoc-next) Handle empty directories
---
hyperdrive-ewoc.el | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/hyperdrive-ewoc.el b/hyperdrive-ewoc.el
index 10cc500663..5eaec8e73d 100644
--- a/hyperdrive-ewoc.el
+++ b/hyperdrive-ewoc.el
@@ -79,12 +79,18 @@ column headers."
;; `cursor-intangible' on the column header causes `hl-line-mode' to
;; highlight the wrong line when crossing over the headers.
(let ((lines-below-header (- (line-number-at-pos) 2)))
- (if (cl-plusp lines-below-header)
- (h/ewoc-move n)
- ;; Point on first line or column header:
- ;; jump to first ewoc entry and then maybe move.
- (goto-char (ewoc-location (ewoc-nth h/ewoc 0)))
- (h/ewoc-move (1- n)))))
+ (cond ((cl-plusp lines-below-header)
+ (h/ewoc-move n))
+ ((ewoc-nth h/ewoc 0)
+ ;; Point on first line or column header and directory has contents:
+ ;; jump to first ewoc entry and then maybe move.
+ (goto-char (ewoc-location (ewoc-nth h/ewoc 0)))
+ (h/ewoc-move (1- n)))
+ (t
+ ;; Point on first line or column header and directory is empty:
+ ;; jump past header line.
+ (goto-char (point-min))
+ (forward-line 2)))))
(cl-defun h/ewoc-previous (&optional (n 1))
"Move backward N entries.