Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: textmate-goto-file slow when default-directory does not expand #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions textmate.el
Original file line number Diff line number Diff line change
Expand Up @@ -295,17 +295,17 @@ Symbols matching the text at point are put first in the completion list."
"Uses your completing read to quickly jump to a file in a project."
(interactive)
(let ((root (textmate-project-root)))
(when (null root)
(when (null root)
(error "Can't find any .git directory"))
(find-file
(concat
(find-file
(concat
(expand-file-name root) "/"
(textmate-completing-read
(textmate-completing-read
"Find file: "
(mapcar
(lambda (e)
(replace-regexp-in-string (textmate-project-root) "" e))
(textmate-cached-project-files (textmate-project-root))))))))
(lambda (e)
(replace-regexp-in-string root "" e))
(textmate-cached-project-files root)))))))

(defun textmate-clear-cache ()
"Clears the project root and project files cache. Use after adding files."
Expand Down Expand Up @@ -356,7 +356,8 @@ Symbols matching the text at point are put first in the completion list."
"Returns the current project root."
(when (or
(null *textmate-project-root*)
(not (string-match *textmate-project-root* default-directory)))
(not (string-match *textmate-project-root*
(expand-file-name default-directory))))
(let ((root (textmate-find-project-root)))
(if root
(setq *textmate-project-root* (expand-file-name (concat root "/")))
Expand Down