diff options
| author | Eli Zaretskii | 2025-03-13 12:34:23 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2025-03-13 12:34:23 +0200 |
| commit | 04034cd9ce746e3914daa66add34c66ad2db032d (patch) | |
| tree | a8112c1246109013d624320abb972ec7a4566669 | |
| parent | f8443dffc1fd2bc4b561b94c21cda887d2936d63 (diff) | |
| download | emacs-04034cd9ce746e3914daa66add34c66ad2db032d.tar.gz emacs-04034cd9ce746e3914daa66add34c66ad2db032d.zip | |
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'." | |||
| 2888 | (setq wrapped t)) | 2888 | (setq wrapped t)) |
| 2889 | ;; `bounded': go back to the last non-empty line. | 2889 | ;; `bounded': go back to the last non-empty line. |
| 2890 | (dired-movement-style ; Either 'bounded or anything else non-nil. | 2890 | (dired-movement-style ; Either 'bounded or anything else non-nil. |
| 2891 | (while (and (dired-between-files) (not (zerop arg))) | 2891 | (while (and (dired-between-files) |
| 2892 | (not (dired-get-subdir)) | ||
| 2893 | (not (zerop arg))) | ||
| 2892 | (funcall jumpfun (- moving-down)) | 2894 | (funcall jumpfun (- moving-down)) |
| 2893 | ;; Point not moving means infinite loop. | 2895 | ;; Point not moving means infinite loop. |
| 2894 | (if (= old-position (point)) | 2896 | (if (= old-position (point)) |
| 2895 | (setq arg 0) | 2897 | (setq arg 0) |
| 2896 | (setq old-position (point)))) | 2898 | (setq old-position (point)))) |
| 2897 | ;; Encountered a boundary, so let's stop movement. | 2899 | ;; Encountered a boundary, so let's stop movement. |
| 2898 | (setq arg (if (dired-between-files) 0 moving-down))))) | 2900 | (setq arg (if (and (dired-between-files) |
| 2899 | (unless (dired-between-files) | 2901 | (not (dired-get-subdir))) |
| 2902 | 0 moving-down))))) | ||
| 2903 | (unless (and (dired-between-files) (not (dired-get-subdir))) | ||
| 2900 | ;; Has moved to a non-empty line. This movement does | 2904 | ;; Has moved to a non-empty line. This movement does |
| 2901 | ;; make sense. | 2905 | ;; make sense. |
| 2902 | (cl-decf arg moving-down)) | 2906 | (cl-decf arg moving-down)) |