emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 15/52: company-files-complete: move files in subdirs to the end


From: Dmitry Gutov
Subject: [elpa] 15/52: company-files-complete: move files in subdirs to the end
Date: Tue, 01 Jul 2014 11:53:11 +0000

dgutov pushed a commit to branch master
in repository elpa.

commit d2269a13c3b635c1a5ac96bbc6284feb71021214
Author: Dmitry Gutov <address@hidden>
Date:   Mon May 26 21:39:23 2014 +0300

    company-files-complete: move files in subdirs to the end
    
    #116
---
 company-files.el |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/company-files.el b/company-files.el
index a839f79..3dc4d86 100644
--- a/company-files.el
+++ b/company-files.el
@@ -59,17 +59,19 @@
 (defun company-files-complete (prefix)
   (let* ((dir (file-name-directory prefix))
          (file (file-name-nondirectory prefix))
-         candidates)
+         candidates directories)
     (unless (equal dir (car company-files-completion-cache))
       (dolist (file (company-files-directory-files dir file))
         (setq file (concat dir file))
         (push file candidates)
         (when (file-directory-p file)
-          ;; Add one level of children.
-          (dolist (child (company-files-directory-files file ""))
-            (push (concat file
-                          (unless (eq (aref file (1- (length file))) ?/) "/")
-                          child) candidates))))
+          (push file directories)))
+      (dolist (directory (reverse directories))
+        ;; Add one level of children.
+        (dolist (child (company-files-directory-files directory ""))
+          (push (concat directory
+                        (unless (eq (aref directory (1- (length directory))) 
?/) "/")
+                        child) candidates)))
       (setq company-files-completion-cache (cons dir (nreverse candidates))))
     (all-completions prefix
                      (cdr company-files-completion-cache))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]