Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

Commit

Permalink
fix tramp handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma committed Sep 3, 2018
1 parent b772699 commit 961f025
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions git-gutter+.el
Expand Up @@ -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)
Expand Down

0 comments on commit 961f025

Please sign in to comment.