diff options
| author | Eli Zaretskii <eliz@gnu.org> | 2025-03-13 12:34:23 +0200 |
|---|---|---|
| committer | Eli Zaretskii <eliz@gnu.org> | 2025-03-13 12:34:23 +0200 |
| commit | 04034cd9ce746e3914daa66add34c66ad2db032d (patch) | |
| tree | a8112c1246109013d624320abb972ec7a4566669 | |
| parent | f8443dffc1fd2bc4b561b94c21cda887d2936d63 (diff) | |
Fix 'dired-movement-style' in Dired when subdirs are shown
* lisp/dired.el (dired--move-to-next-line): Don't consider
sub-directory lines as empty. (Bug#76596)
| -rw-r--r-- | lisp/dired.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/dired.el b/lisp/dired.el index 90d944c5dd4..17c8ba5f123 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2888,15 +2888,19 @@ is controlled by `dired-movement-style'." (setq wrapped t)) ;; `bounded': go back to the last non-empty line. (dired-movement-style ; Either 'bounded or anything else non-nil. - (while (and (dired-between-files) (not (zerop arg))) + (while (and (dired-between-files) + (not (dired-get-subdir)) + (not (zerop arg))) (funcall jumpfun (- moving-down)) ;; Point not moving means infinite loop. (if (= old-position (point)) (setq arg 0) (setq old-position (point)))) ;; Encountered a boundary, so let's stop movement. - (setq arg (if (dired-between-files) 0 moving-down))))) - (unless (dired-between-files) + (setq arg (if (and (dired-between-files) + (not (dired-get-subdir))) + 0 moving-down))))) + (unless (and (dired-between-files) (not (dired-get-subdir))) ;; Has moved to a non-empty line. This movement does ;; make sense. (cl-decf arg moving-down)) |
