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
"git-gutter+-refresh wrong type argument" when saving and opening file with Tramp over SSH #12860
Comments
Same issue here ! |
The workaround doesn't work as of March 21 2020 What does work, however, is the following code snippet under (defun git-gutter+-remote-default-directory (dir file)
(let* ((vec (tramp-dissect-file-name file))
(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 (tramp-file-name-localname (tramp-dissect-file-name file))))
(replace-regexp-in-string (concat "\\`" dir) "" file))) Source: nonsequitur/git-gutter-plus#39 (comment) Edit: it works sometimes. |
Both workarounds don't improve this behaviour for me... |
You’re right @ngoonee, it’s not working now. |
I put this inside (defun dotspacemacs/user-config ()
"Configuration for user code:
This function is called at the very end of Spacemacs startup, after layer
configuration.
Put your configuration code here, except for variables that should be set
before packages are loaded."
;; fixes to git-gutter+ when using tramp
(with-eval-after-load 'git-gutter+
;; https://github.com/syl20bnr/spacemacs/issues/12860#issuecomment-602084919
(defun git-gutter+-remote-default-directory (dir file)
(let* ((vec (tramp-dissect-file-name file))
(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 (tramp-file-name-localname (tramp-dissect-file-name file))))
(replace-regexp-in-string (concat "\\`" dir) "" file)))
)
) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid! |
This definitely did the trick! Perhaps your proposal should be integrated into Spacemacs 😄 |
Thanks @datalogics-kam! This worked for me too! |
Description
Git gutter reports error with tramp on open and save
Reproduction guide 🪲
Observed behaviour: 👀 💔
The file saves correctly but the git-gutter+-refresh reports a wrong argument error and the same error on file open (thouugh file opens correctly).
Expected behaviour: ❤️ 😄
Pretty much the same without the git-gutter error
System Info 💻
Backtrace 🐾
The text was updated successfully, but these errors were encountered: