Skip to content

Commit d1a2bda

Browse files
committed
fix(Fuco1#145): test if file name exists before testing remoteness
1 parent 1f19e24 commit d1a2bda

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dired-collapse.el

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,10 @@
102102
(insert-directory file dired-listing-switches nil nil)
103103
(forward-line -1)
104104
(dired-align-file (line-beginning-position) (1+ (line-end-position)))
105-
(when (file-remote-p (dired-utils-get-filename))
106-
(while (search-forward (dired-current-directory) (line-end-position) t)
107-
(replace-match ""))))
105+
(-when-let (replaced-file (dired-utils-get-filename))
106+
(when (file-remote-p replaced-file)
107+
(while (search-forward (dired-current-directory) (line-end-position) t)
108+
(replace-match "")))))
108109

109110
(defun dired-collapse--create-ov (&optional to-eol)
110111
"Create the shadow overlay which marks the collapsed path.

0 commit comments

Comments
 (0)