Permalink
Browse files

fix tramp handling

  • Loading branch information...
sigma committed Sep 3, 2018
1 parent b772699 commit 961f0257c4f33c8e603c64f4b53a89acbfa7a008
Showing with 7 additions and 5 deletions.
  1. +7 −5 git-gutter+.el
@@ -580,13 +580,15 @@ Returns t on zero exit code, nil otherwise."

(defun git-gutter+-remote-default-directory (dir file)
(let* ((vec (tramp-dissect-file-name file))
(method (aref vec 0))
(user (aref vec 1))
(host (aref vec 2)))
(format "/%s:%s%s:%s" method (if user (concat user "@") "") host dir)))
(method (tramp-file-name-method vec))
(user (tramp-file-name-user vec))
(domain (tramp-file-name-domain vec))
(host (tramp-file-name-host vec))
(port (tramp-file-name-port vec)))
(tramp-make-tramp-file-name method user domain host port dir)))

(defun git-gutter+-remote-file-path (dir file)
(let ((file (aref (tramp-dissect-file-name file) 3)))
(let ((file (tramp-file-name-localname (tramp-dissect-file-name file))))
(replace-regexp-in-string (concat "\\`" dir) "" file)))

(defun git-gutter+-local-file-path (file)

0 comments on commit 961f025

Please sign in to comment.