Skip to content

sort file list by length of path for command-t #18

Closed
wants to merge 1 commit into from
+6 −1
View
7 textmate.el
@@ -316,7 +316,7 @@ Symbols matching the text at point are put first in the completion list."
;;; Utilities
-(defun textmate-project-files (root)
+(defun textmate-find-project-files (root)
"Finds all files in a given project."
(split-string
(shell-command-to-string
@@ -328,6 +328,11 @@ Symbols matching the text at point are put first in the completion list."
*textmate-project-root*
"/::'")) "\n" t))
+(defun textmate-project-files (root)
+ (sort
+ (textmate-find-project-files root)
+ '(lambda (a b) (< (length a) (length b)))))
+
;; http://snipplr.com/view/18683/stringreplace/
(defun textmate-string-replace (this withthat in)
"replace THIS with WITHTHAT' in the string IN"
Something went wrong with that request. Please try again.