branch: master
commit 272b5159d47a241fd9499ac6986ec3daef407ad3
Author: Alexey Veretennikov <[email protected]>
Commit: Alexey Veretennikov <[email protected]>
Fixed issue #35: 'x' key in ztree-dir was broken
---
ztree-dir.el | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/ztree-dir.el b/ztree-dir.el
index d3d3b25..a340c5e 100644
--- a/ztree-dir.el
+++ b/ztree-dir.el
@@ -145,6 +145,13 @@ Otherwise, the ztree window is used to find the file."
(ztree-refresh-buffer))
+(defun ztree-dir-directory-files (path)
+ "Returns the list of files/directories for the given PATH"
+ ;; remove . and .. from the list of files to avoid infinite
+ ;; recursion
+ (remove-if (lambda (x) (string-match-p "/\\.\\.?$" x))
+ (directory-files path 'full)))
+
;;;###autoload
@@ -160,7 +167,7 @@ Otherwise, the ztree window is used to find the file."
#'ztree-file-short-name
#'file-directory-p
#'string-equal
- (lambda (x) (directory-files x 'full))
+ #'ztree-dir-directory-files
nil ; face
#'ztree-find-file) ; action
(ztreedir-mode))))