Prevent ehsell-starship extensions from applying to hidden files
This commit is contained in:
@ -856,6 +856,12 @@ That is, if EXT is \"pkg.tar.gz\", this will return
|
|||||||
(eshell-starship--permute-extension
|
(eshell-starship--permute-extension
|
||||||
(eshell-starship--file-name-extension file))))
|
(eshell-starship--file-name-extension file))))
|
||||||
|
|
||||||
|
(defun eshell-starship--hidden-file-p (name)
|
||||||
|
"Return non-nil if the file with NAME is hidden.
|
||||||
|
Name must be the name of a file, not a path. Thus, is cannot have any '/'
|
||||||
|
characters in it."
|
||||||
|
(and (cl-plusp (length name)) (= (aref name 0) ?.)))
|
||||||
|
|
||||||
(defun eshell-starship--modules-for-dir (dir)
|
(defun eshell-starship--modules-for-dir (dir)
|
||||||
"Return a list of modules that are applicable to DIR."
|
"Return a list of modules that are applicable to DIR."
|
||||||
(let ((is-remote (eshell-starship--remote-for-modules-p dir)))
|
(let ((is-remote (eshell-starship--remote-for-modules-p dir)))
|
||||||
@ -872,7 +878,8 @@ That is, if EXT is \"pkg.tar.gz\", this will return
|
|||||||
(copy-sequence (eshell-starship--module-by :dirs name))
|
(copy-sequence (eshell-starship--module-by :dirs name))
|
||||||
(apply 'append
|
(apply 'append
|
||||||
(eshell-starship--module-by :files name)
|
(eshell-starship--module-by :files name)
|
||||||
(eshell-starship--extension-modules-for-file name)))))
|
(unless (eshell-starship--hidden-file-p name)
|
||||||
|
(eshell-starship--extension-modules-for-file name))))))
|
||||||
(directory-files-and-attributes dir nil nil t)))
|
(directory-files-and-attributes dir nil nil t)))
|
||||||
(let ((default-directory dir))
|
(let ((default-directory dir))
|
||||||
(cl-loop for (name is-dir module) in eshell-starship--extra-module-files
|
(cl-loop for (name is-dir module) in eshell-starship--extra-module-files
|
||||||
|
|||||||
Reference in New Issue
Block a user