* spacemacs-defaults: fix err msg when copy file path in a dired buffer

This commit is contained in:
Lin Sun 2022-11-02 00:00:17 +00:00 committed by Maxi Wolff
parent df39c561bb
commit ab5911fabd
1 changed files with 2 additions and 1 deletions

View File

@ -779,7 +779,8 @@ ones created by `magit' and `dired'."
(defun spacemacs/copy-file-name ()
"Copy and show the file name of the current buffer."
(interactive)
(if-let (file-name (file-name-nondirectory (spacemacs--file-path)))
(if-let* ((file-path (spacemacs--file-path))
(file-name (file-name-nondirectory file-path)))
(progn
(kill-new file-name)
(message "%s" file-name))